Link to home
Start Free TrialLog in
Avatar of SweetingA
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
ASKER CERTIFIED SOLUTION
Avatar of mbizup
mbizup
Flag of Kazakhstan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
try this


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