Link to home
Start Free TrialLog in
Avatar of parkerea
parkereaFlag for United States of America

asked on

MS Access - BeforeUpdate for form validations

In an Access database, I am trying to use the BeforeUpdate event, specifically the Form_BeforeUpdate sub, to validate the row, then set Cancel if it fails so the row is not posted to the DB. The problem is in addition to being run before the row is posted, Form_BeforeUpdate is run after the field is updated, and I can't tell if the user updated a field & tabbed out, or if the user attempted to leave the row & post it to the DB.

How can I tell if the Form_BeforeUpdate is being run as after as field level validation or as a row level validation?

Thanks in advance,
parkerea
ASKER CERTIFIED SOLUTION
Avatar of MikeToole
MikeToole
Flag of United Kingdom of Great Britain and Northern Ireland 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
Avatar of parkerea

ASKER

That is actually what I thought, but I found the problem: this form was developed by someone else and it has some stuff that I did not know was there. One of the fields was calling a macro on the "After Update" event, and that macro had RunCommand / SaveRecord in it, so it was that macro that was triggering the call to the form's Form_BeforeUpdate() sub. It made it LOOK like changing & tabbing out of that field was calling Form_BeforeUpdate().

Thanks again,
parkerea