Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access Lookup Problem

Status
Not open for further replies.

Trob70

Programmer
Sep 25, 2012
89
AU
I am having a problem with the following line


sql2 = "SELECT * FROM [wol] WHERE trim([Title]) = '" & Trim(TextBox4.Text) & "' and trim([publisher]) = '" & Trim(TextBox8.Text) & "' and trim(
Code:
) = '" & Trim(TextBox7.Text) & "' and trim([composer]) = '" & Trim(TextBox9.Text) & "'"



The problem is   The Textbox8.text  is eg isn't it  (for example)

ie  the is a  '    in the lookup

The program bombs out

is there a way of doing a lookup  with a  '   in texttbox i am using for the lookup


Appreciate any help


Trob70
 
First of all, I suggest you use stored procedures.
Second, you have to replace any single quote ("'") with double single quotes ("''")
 
jbenson001

Thanks for your advice.....

Did not realize that ado had this problem Have allways been use Dao in vb6

Thanks for you advice

Regards Trob70


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top