When enter a last name in a form, it generates a count of the last name in the source table. The count is used to display a list of same names if count >1. It works fine except if a name has an apostrophe (like O'Briant)
Here is the code that works fine with no apostrophe included. LN is field where enter last name.
CountLN = DCount("[lname]", "[T_Customer]", "lname = '" & [LN] & "'")
When last name includes a space or dash, no problem
When the name includes an apostrophe, get this message:
Syntax error (Missing Operator) in query expression "Lname=O'Briant"
Any help much much appreciated.