Access Problem with " ' "

  • Thread starter Thread starter =C-Black=
  • Start date Start date
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.
 
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
 
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 " ' ' "
 
Back
Top