This code works just perfect if I use something else than Lion's Club for the search, or something else without an apostrophe. I get the error Runtime error '3077'; Syntax error (mission operator) in expression. How can I do that whatever text I'm looking for doesnt affect the syntaxis. Thanks
Dim db As Database
Dim rst As DAO.Recordset
Set db = CurrentDb
Set rst = db.OpenRecordset("agency", dbOpenDynaset)
xagency = Me.agency.Text
rst.FindFirst "[agency] =' "Lion's Club" ' "
If rst.NoMatch And xagency <> "" Then
MsgBox "No Records Matching " & InputText, vbOKOnly, "No Matching"
xno = 1
Else
xno = 0
End If
Dim db As Database
Dim rst As DAO.Recordset
Set db = CurrentDb
Set rst = db.OpenRecordset("agency", dbOpenDynaset)
xagency = Me.agency.Text
rst.FindFirst "[agency] =' "Lion's Club" ' "
If rst.NoMatch And xagency <> "" Then
MsgBox "No Records Matching " & InputText, vbOKOnly, "No Matching"
xno = 1
Else
xno = 0
End If