Hi
I have a DLookup on a form to identify whether a person has been already entered. The code is
This works fine, or at least it did until I built in a Celtic name corrector. No problem with Mcs and Macs but when I try entering an O' name I get an error on the DLookup.
It says "Syntax error (missing operator) in query expression '[strConSname] = 'O'Dude' And [strConFname] = 'Jim' And [strConAdd1] = '16 High Street"
I think it is because of the additional apostrophe in the surname since when I change O'Dude to Jones it doesn't have a problem.
My comprehension of SQL aprostrophies is weak at the best of times but can anyone tell me how I resolve this please?
Any help greatly appreciated.
Best wishes
I have a DLookup on a form to identify whether a person has been already entered. The code is
Code:
varX = DLookup("lngConId", "tblContacts", "[strConSname] = '" & Me.txtSname & "' And [strConFname] = '" & Me.txtFname & "' And [strConAdd1] = '" & Me.txtAddr1 & "'")
It says "Syntax error (missing operator) in query expression '[strConSname] = 'O'Dude' And [strConFname] = 'Jim' And [strConAdd1] = '16 High Street"
I think it is because of the additional apostrophe in the surname since when I change O'Dude to Jones it doesn't have a problem.
My comprehension of SQL aprostrophies is weak at the best of times but can anyone tell me how I resolve this please?
Any help greatly appreciated.
Best wishes