Reputation:
Below query is resulting zero rows updated
but i am sure that there is a record to update
DoCmd.RunSQL (" Update tbltesting set IsDiff ='Yes' " & _
"where empid= " & Me.txtEmpId.Value & _
" and testid= " & Me.txtAutoNumber.Value & ";")
Please help!!
Upvotes: 1
Views: 2068
Reputation: 1506
Run this as a check to make sure your fields have the data that you think they have:
DoCmd.RunSQL (" SELECT * FROM tbltesting " & _
"WHERE empid= " & Me.txtEmpId.Value & _
" and testid= " & Me.txtAutoNumber.Value & ";")
Incidentally, you can leave off the .Value portion.
Upvotes: 1
Reputation:
In debug mode cut and paste the delete statement with the actual values into whatever database development environment you are using - run the query in the data base this will tell you if there is a syntax problem or data problem
Upvotes: 0
Reputation: 1938
Try removing .Value and ; If it still not updating then change 'Yes' to 1.
You can also try Yes without single quotes.
Upvotes: 0
Reputation: 26190
Maybe you need single quotes around the WHERE parameters:
DoCmd.RunSQL (" Update tbltesting set IsDiff ='Yes' where empid= '" & Me.txtEmpId.Value & "' and testid= '" & Me.txtAutoNumber.Value & "';")
Upvotes: 0