Hello,
I built the update qry which has criteria and update To fields set from the form which I am attempting to execute via VBA. When I run the VBA it throws a runtime error 3061. Not sure where the mistake is. I checked to see if there was a typo anywhere, but unable to find it. Please let me know how can it be fixed.
SQL of the Qry
VBA
I built the update qry which has criteria and update To fields set from the form which I am attempting to execute via VBA. When I run the VBA it throws a runtime error 3061. Not sure where the mistake is. I checked to see if there was a typo anywhere, but unable to find it. Please let me know how can it be fixed.
SQL of the Qry
Code:
UPDATE TblUsers SET TblUsers.EmpName = [Forms]![frmAddEditEmployee]![txtEmpName], TblUsers.LicNo = [Forms]![frmAddEditEmployee]![txtLicNo], TblUsers.UserName = [Forms]![frmAddEditEmployee]![txtUserName], TblUsers.AccessLevel = [Forms]![frmAddEditEmployee]![CboAccess], TblUsers.Deactive = [Forms]![frmAddEditEmployee]![chkDeActive]
WHERE (((TblUsers.ID)=[Forms]![frmAddEditEmployee]![txtPin]));
VBA
Code:
Private Sub cmdSave_Click()
Dim db As DAO.Database
Set db = CurrentDb
db.Execute "QryUpdateUser", dbFailOnError
db.Close
Set db = Nothing