Reread Roger's response. He doesn't have single quotes around Fisher's Arm:
just double ones.
If for some reason you must use single quotes as your delimiter, then your
other option is to change the string by replacing each occurrance of the
delimiter inside the string with two occurrances of the delimiter. Assuming
you're using Access 2000 or higher, this can be accomplished as:
Dim strLookup As String
Dim strSQL As String
strLookup = "Fisher's Arm"
strSQL = "UPDATE Master SET [Sub Title] = '" & _
Replace(strLookup, "'", "''") & "'"
Exagerated for effect, that's
strSQL = "UPDATE Master SET [Sub Title] = ' " & _
Replace(strLookup, " ' ", " ' ' ") & " ' "
You can also use Replace(strLookup, Chr$(39), Chr$(39) & Chr$(39)), or
strSQL = "UPDATE Master SET [Sub Title] = " & Chr$(39) & _
Replace(strLookup, Chr$(39), Chr$(39) & Chr$(39)) & Chr$(39)
--
Doug Steele, Microsoft Access MVP
(No private e-mails, please)
ftec said:
Are you creating this programmatically?
Yes, the " " won't help; the exact error msg will be:
Syntax error (missing operator) in query expression ''"Fisher's Arm"' WHERE
ID = 32;'.
Roger Carlson said:
Use quote marks:
UPDATE Master SET [Sub Title] = "Fisher's Arm" WHERE ID = 32
--
--Roger Carlson
Access Database Samples:
www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
"ftec" <ftecatkolumbusfi> wrote in message
The ' in the word Fisher's occasionally causes an sql error?
UPDATE Master SET [Sub Title] = 'Fisher's Arm' WHERE ID = 32;
thanks
Johannes