Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do you handle the apostrophe in a findfirst?

Status
Not open for further replies.

colezpapa

Programmer
Feb 26, 2007
86
0
0
US
Using findfirst, I need to handle apostrophes.
rsChar.FindFirst "[LETTER] = " & "'" & current_char & "'"

How would I re-work this to handle the apostrophe?
 
Two ideas:

[tt]rs.FindFirst "[LETTER] = " & Chr(34) & current_char & Chr(34)
Debug.Print rs![LETTER] [/tt]


[tt]rs.FindFirst "[LETTER] = '" & Replace(current_char, "'", "''") & "'"
Debug.Print rs![LETTER][/tt]

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top