Have an SQL statement that returns the relevant details based apon a LIKE statement.. This works fine at the moment until you get to the point where you run an LIKE with a ' in it..
This SQL statement searches through the field that holds the clients last names.. The problem occours if you enter, for example, a name like O'Connor.
User_Details is the table
LastName is the field
TxtLastL is the text box
strSql = "Select * from User_Details2 WHERE LastName LIKE '" & Me.TxtLastL & "%'"
You might be wondering why % and * is not.. Was helped out by a good dude on the net who told me that he also had the same problem and it worked for him and sure enough it worked.
Does anyone know of a way of running this SQL statement to accept ' in the Text box
Thanx
This SQL statement searches through the field that holds the clients last names.. The problem occours if you enter, for example, a name like O'Connor.
User_Details is the table
LastName is the field
TxtLastL is the text box
strSql = "Select * from User_Details2 WHERE LastName LIKE '" & Me.TxtLastL & "%'"
You might be wondering why % and * is not.. Was helped out by a good dude on the net who told me that he also had the same problem and it worked for him and sure enough it worked.
Does anyone know of a way of running this SQL statement to accept ' in the Text box
Thanx