I'm having a problem with a syntax error in an SQL statement inside of
some code I'm working on. Some records in one of the the data fields
I'm trying to query have an apostophe in the name (it is a customer's
name, so it should be spelled correctly if possible, including the
apostrophe), and that is causing the following SQL statement to give a
syntax error whenever one of those records is reached:

sql2 = "SELECT tblCustRMAs.CompanyName, tblCustRMAs.CustID " & _
       "FROM tblCustRMAs " & _
       "WHERE (((tblCustRMAs.CompanyName)= '" & CurrentCustName & "'));"


If anyone can suggest a change to this statement so that records with
apostrophes in the Company Name field will not cause it to crash, I
would greatly appreciate it!

Many thanks,

Bill R.






 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ms_access/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to