Access Problem with " ' "

C

=C-Black=

Hi All,
In the database of my company, it contain some data which with " ' " ,
e.g. ( Ass'y , I's )
Those data cause error on query. Anyway to advice from those problem ?
Thank you for help.
C.B.
 
C

=C-Black=

Actually, there is a textbox for inputing data. And I need to check up
if any same data exsit.
So I use Adodb.recordset with SQL statments: "Select * FROM dbs WHERE
((Supplie)r= '" & Me.textbox & "');"
And check for the EOF and BOF . But the error happen when I input
"Ass'y" in that textbox.

Thank you Ken Snell
 
D

Douglas J. Steele

Change your SQL statement to

"Select * FROM dbs WHERE ((Supplier)= '" & Replace(Me.textbox, "'", "''") &
"');"

where the 2nd argument in the Replace function is " ' ", and the 3rd
argument is " ' ' "
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top