Getting Syntax Error

  • Thread starter Thread starter Junior
  • Start date Start date
J

Junior

Hi - i'm getting a syntax error 3075 for the where clause in the below SQL
statement.
i've tried substituting chr39 and removing " but not found the right
combination
appreciate any help, pointers, advice

strSQL = "DELETE tblReviewed.*, tblReviewed.SSN, tblReviewed.RmkID " & _
"FROM tblReviewed " & _
"WHERE (((tblReviewed.SSN)=" & Chr(34) & strSSN & Chr(34) & " AND " &
_
"((tblReviewed.RmkID)=" & Chr(34) & strRmk & Chr(34) & ";"
 
Hi Jr.,

Should be Chr(39), but should be before the double
quotes. This may be a cleaner way to write it:

strSQL = "DELETE tblReviewed.*, tblReviewed.SSN,
tblReviewed.RmkID " & _
"FROM tblReviewed " & _
"WHERE tblReviewed.SSN = '" & strSSN & "' AND " &
"tblReviewed.RmkID= '" & strRmk & "';"

Of course, I'm assuming both strSSN and strRmk are both
strings (which looks to be the case).

Regards,
Jen
 
Back
Top