I have a form that has things like the date, a dealer name, the quote number, make, model, and cost for a quote that my salesmen create. There is a button on this form called Change Dealer that allows the salesmen to change the name of a dealer. Change Dealer button will open another form with a combobox that lists the dealer names. So the salesmen could change it from Stock Trailer to Trailerworld for example and the dealer name would change on my quotes form. This works unless the first word in the dealer name is "Mobile". I I tried to create a variable but I got the 94 invalid use of null error. If I add a blank space before Mobile in the table then the dealer name will change on the quotes form. I also tried to add a blank space in my string with no luck. So is "Mobile" a reserved word? This only seems to happen with that word. My code is:
Thanks!
Code:
Option Compare Database
Option Explicit
Private Sub cmdSave_Click()
On Error GoTo Err_ErrHandle
Dim sSql As String
sSql = "UPDATE tblQuotes SET [DealerName] = '" & Me.DealerID.Column(0) & "'"
sSql = sSql & " WHERE QuoteNum = " & Form_frmCustomQuote.QuoteNum
DoCmd.SetWarnings False
DoCmd.RunSQL sSql
DoCmd.SetWarnings True
Form_frmCustomQuote.Requery
DoCmd.Close
Exit_ErrHandle:
Exit Sub
Err_ErrHandle:
MsgBox Err.Number & Err.Description
Resume Exit_ErrHandle
End Sub
Thanks!