Update checkbox value using SQL

CBG2112

Registered User.
Local time
Today, 07:03
Joined
Aug 4, 2009
Messages
32
I'm trying to update the following fields using SQL. The code used to work until I added the COMPLETE_FL part. When I run it, it returns with an error message "Syntax error (missing operator) in query expression "'[COMPLETE_FL]=-1'. I've tried different variations using the quotation marks but none seems to work. Your help would be appreciated. Thanks.
Code:
  Dim strSQL As String
    cboDSStatus.SetFocus
    strSQL = "UPDATE tblN " & _
                "SET [N_STATUS]=" & Chr(34) & Me.cboDSStatus.Text & Chr(34) & ", " & _
                "[QCUSER]='" & xUserName & "' " & _
                "[COMPLETE_FL]=" & Me.COMPLETE_FL.Value & " " & _
                "WHERE [N_ID]=" & Me.N_ID.Value
    DoCmd.RunSQL strSQL
 
I think you are missing a comma (see red area):

"[QCUSER]='" & xUserName & "' " & _
"[COMPLETE_FL]=" & Me.COMPLETE_FL.Value & " " & _

"[QCUSER]='" & xUserName & "', " & _
"[COMPLETE_FL]=" & Me.COMPLETE_FL.Value & " " & _
 

Users who are viewing this thread

Back
Top Bottom