I'm sure this a problem that a lot of you have seen before. When trying to use the Find method on a string that contains an apostrophe, an error occurs.

For example:

rcset_master.Find "String = '" & txtBox.text & "'"

where txtbox.text = "Bob's Sporting Goods"

I've searched through the VBWorld Q and A, and found a fix for this problem, which involves replacing all single quotes in the search string with two single quotes. ie:

rcset_master.Find "String = '" & replace(txtbox.text, "'", "''") & "'"

This solution works fine for strings that contain only ONE apostrophe to start with. However, it does not work for a string with more than one to start, like:

"Please finish setting the printer's options on the printer's panel before continuing."

Has anyone found a workaround for this problem? Is there a MS KB article?

TIA,

Nahid Harjee