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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Syntax for string that contains an apostrophe 1

Status
Not open for further replies.

theSizz

Technical User
Apr 22, 2002
93
US
Can some one help with the proper syntax for having a form filter a string that contains an apostrophe.
Such as a field with the name O'Toole in it.
Here's what I wrote but it produces an error.

Code:
Private Sub Form_Load()

DoCmd.ApplyFilter , "provider = 'O'Toole' or provider2 = 'O'Toole'"

End Sub

I realize it's the apostrophe in O'Toole that is causing the problem. I just don't know how to write the proper syntax.
Can some one help?

Thanks for the help.
 
Code:
Private Sub Form_Load()

DoCmd.ApplyFilter , "provider = 'O''Toole' or provider2 = 'O''Toole'"

End Sub
 
Thanks for the quick reply Golom.
That did the trick.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top