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) & " "
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top