Solved There is a syntax error for this SQL

hucheunghugo

New member
Local time
Today, 20:22
Joined
Apr 11, 2022
Messages
23
Code:
        DoCmd.RunSQL "Update VIPcustomer SET VIPcustomer.Condition = 1 WHERE ((VIPcustomer.VIPID) = &X);"
I have tried different way, it stills shows syntax error.
 
Code:
        DoCmd.RunSQL "Update VIPcustomer SET Condition = 1 WHERE VIPID = " & X & ";"
 
I refer you back to this previous suggestion: similar problem

Use a variable so you can check the SQL from your concatenation:

Code:
  Dim strSQL As String
 
  strSQL = "Update VIPcustomer SET Condition = 1 WHERE VIPID = " & X & ";"
  Debug.Print strSQL
  DoCmd.RunSQL strSQL
 
Last edited:

Users who are viewing this thread

Back
Top Bottom