DLookup for Irish people ??

W

Wayne-I-M

MY wonderfull on-line access booking system (tested for ages) has just
failed on the third application. Why ? An Irish person (booking from
someone in Dublin) named Mr O'Rourke

strID = Nz(DLookup("[CDClientID]", "[TblClients]", "[CD1stName] ='" &
Form!txt1stName & "' AND [CDSurname] = '" & Form!txtSurname & "'AND
[CDDateofBirth] = " & Format(Form!frmNewBookings!txtDateofBirth,
"\#yyyy\-mm\-dd\#")), "0")
Helped by Douglas Steel and John Vinson

Has anyone an idea of how to amend the above to cope with O'Rourke,
O'Donnel, M'Clishe or even O'Shuanasey'Smith.

The lookup is looking for 'ORourke', and the extra apostrophe is making this
2 words - Mr O and Mr Rourke

Any tips would be really helpful
 
A

Allen Browne

Use the double-quote character, doubled up inside the quotes:

strID = Nz(DLookup("[CDClientID]", "[TblClients]", "[CD1stName] =""" &
Form!txt1stName & ""' AND [CDSurname] = """ & Form!txtSurname &
""" AND [CDDateofBirth] = " &
Format(Form!frmNewBookings!txtDateofBirth, "\#yyyy\-mm\-dd\#")), "0")

Explanation:
Quotation marks within quotes
at:
http://allenbrowne.com/casu-17.html
 
C

CyberDwarf

Try doing a replace of the single quote with two single quotes, before
executing the query.

NB. I am not suggesting you save the two single quotes to the database.

HTH

Steve
 
W

Wayne-I-M

Hi Allen

It works perfectly

Thank you


--
Wayne
Manchester, England.



Allen Browne said:
Use the double-quote character, doubled up inside the quotes:

strID = Nz(DLookup("[CDClientID]", "[TblClients]", "[CD1stName] =""" &
Form!txt1stName & ""' AND [CDSurname] = """ & Form!txtSurname &
""" AND [CDDateofBirth] = " &
Format(Form!frmNewBookings!txtDateofBirth, "\#yyyy\-mm\-dd\#")), "0")

Explanation:
Quotation marks within quotes
at:
http://allenbrowne.com/casu-17.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Wayne-I-M said:
MY wonderfull on-line access booking system (tested for ages) has just
failed on the third application. Why ? An Irish person (booking from
someone in Dublin) named Mr O'Rourke

strID = Nz(DLookup("[CDClientID]", "[TblClients]", "[CD1stName] ='" &
Form!txt1stName & "' AND [CDSurname] = '" & Form!txtSurname & "'AND
[CDDateofBirth] = " & Format(Form!frmNewBookings!txtDateofBirth,
"\#yyyy\-mm\-dd\#")), "0")
Helped by Douglas Steel and John Vinson

Has anyone an idea of how to amend the above to cope with O'Rourke,
O'Donnel, M'Clishe or even O'Shuanasey'Smith.

The lookup is looking for 'ORourke', and the extra apostrophe is making
this
2 words - Mr O and Mr Rourke

Any tips would be really helpful
 
Top