I am trying to update columns which contain Null values. I thought that the bellow code would work but I get syntax error for missing operator in query expression. I can't seems to figure it out. Any help?
Private sub dataUpdate_Click()
Dim SQL As String
On Error GoTo cancelledClicked
SQL = "UPDATE table1 " & _
"SET [Column1] = 1 WHERE [Column1] IS NULL " & _
"SET [Column2] = 0 WHERE [Column2] IS NULL; "
DoCmd.RunSQL SQL
exitDataUpdate:
Exit Sub
ignoreError:
MsgBox Err.Description
Exit Sub
cancelledClicked:
If Err.Number = 2501 Then GoTo exitDataUpdate
If Err.Number <> 2501 Then GoTo ignoreError
Resume Next
End sub