Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check Query Successful

Status
Not open for further replies.

boborsipho

Programmer
Sep 6, 2002
14
ZA
How do I check in VBA/Access (if it is possible in Access) that a update query actually updated something and then use the fact that it updated/not.

I've got a log in form that checks if the username & password is valid, and then Activates the use, if found in the table, as Yes (Activates is a flag). I want the form to close if the user was found, or the system should close if the user was not found.

Thanks
Bob
 
Do you really need to validate the successful insert? You could just use VBA to check and see if the user ID and PW exist, and if so, open the form or do other, otherwise close the form, display error message, etc.
You could validate that the insert happened successfully if you use a variable and argument as part of and ADO connection.Execute, you can tell if the update succeeds because it returns the number of records that were updated/inserted.

Chris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top