SweetingA
asked on
Update query syntax
Dim strSQL As String
Dim x As Integer
x = Me.CAPA_Number
strSQL = "UPDATE tbl_Actions SET tbl_Actions.Completed = 1 " & " WHERE [CAPA#] = x"
DoCmd.RunSQL strSQL
I am sure this is very simple for an expert but my x is not seen as a variable, can anyone help woth the syntax please
Dim x As Integer
x = Me.CAPA_Number
strSQL = "UPDATE tbl_Actions SET tbl_Actions.Completed = 1 " & " WHERE [CAPA#] = x"
DoCmd.RunSQL strSQL
I am sure this is very simple for an expert but my x is not seen as a variable, can anyone help woth the syntax please
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
strSQL = "UPDATE tbl_Actions SET tbl_Actions.Completed = 1 WHERE [CAPA#] = " & x
if the field "Completed" is a Yes/No or Tue/False field, use this
strSQL = "UPDATE tbl_Actions SET tbl_Actions.Completed = -1 WHERE [CAPA#] = " & x