Apostrophe problem in filter.

sdawson

Registered User.
Local time
Today, 04:30
Joined
Apr 22, 2003
Messages
165
I’m using a combo box to select real names and using the following event to filter
Private Sub Combo45_Click()
Me.Filter = "[CustomerName] = '" & [Combo45] & "'"
Me.FilterOn = True
Me.GHSpickups.SetFocus
End Sub

Simply stuff so far.

The problem is a real name such as O’Reilly gives a problem because of the apostrophe.
Any way round this would be welcome.
 
Seen this before:
Use double double quotes:
Code:
Me.Filter = "[CustomerName] = """ & [Combo45] & """"
 
Thanks Guss2005.
Works a treat.
 

Users who are viewing this thread

Back
Top Bottom