error in query string

sven2

Registered User.
Local time
Today, 16:09
Joined
Apr 28, 2007
Messages
297
Hello,

when I want ot delete a record and there is a character like ' in the name I get an error in the following string:

DoCmd.RunSQL " DELETE * " _
& " FROM Grade " _
& " WHERE Grade.Grade = ('" & Me.lstpapiersoort.Column(0) & "'); "

I understand why the error is showing up (there is an ' too much in the string, but how can I solve this problem?

As you can see in the code the value for removing the recor is coming out of a list.

Best regards,
Sven.
 
Try this
" WHERE Grade.Grade = (""" & Me.lstpapiersoort.Column(0) & """); "
 

Users who are viewing this thread

Back
Top Bottom