Hi All,
I started exploring the SQL statement in VBA rather than building a query and I am having issue with Update query.
So basically what I want is to get a msgbox which is asking user "If you have a car or not" and based on the answer (YES/NO), I want to check off the checkbox (HasCar) in the TblUsers.
I am capturing UserID in TempVars when user logs in, and was hoping to use that in the query.
I started exploring the SQL statement in VBA rather than building a query and I am having issue with Update query.
So basically what I want is to get a msgbox which is asking user "If you have a car or not" and based on the answer (YES/NO), I want to check off the checkbox (HasCar) in the TblUsers.
I am capturing UserID in TempVars when user logs in, and was hoping to use that in the query.
Code:
If MsgBox("Will you be driving a car to work?", vbYesNo + vbQuestion, "Car Owner Verification") = vbYes Then
CurrentDb.Execute " UPDATE TblUsers SET TblUsers.HasCar = -1 WHERE TblUsers.ID= '" & TempVars("UsrID").Value & "'", dbFailOnError