Single Quote

M

Max

Acc2K. Get an error when using a combo box to find a
record in my form when record contains a single quote,
i.e., Miller's. Believe this is from code which uses the
single quote:
rs.FindFirst "[Company]=' " & Me![Combo1] & " ' "
How can I set a different character to use instead of the
single quote?
Thanks in advance for your help.
Max
 
J

Jeff Pietsch

I just had a similar situation the other day. Try this.

Take out the single quotes and then put double quotes
around your text string by using chr(34).

rs.FindFirst "[Company]= " & chr(34) & Me![Combo1] & chr
(34) & " "
 
Top