Data Validation

B

Bunky

I have put several edits in place to ensure the data is entered on different
forms. Then I found out that if you use the navigation arrows at the bottom
of the screen, all of my edits are bypassed. What event should I use in
order to make certain the data has gone through the edits? I have tried
after update, before update, and several others but no luck yet. Suggestions?
 
S

Scott Lichtenberg

Your validations are probably in the BeforeUpdate event of your form (as
they should be). The problem is that when users scroll between records, if
they haven't changed anything, the BeforeUpdate event doesn't fire off. One
way to ensure that the validations will be run is to make the record dirty.
In the form's OnCurrent event, set a field equal to itself (Me!Field1 =
Me!Field1). Your record is now dirty - you should see the "pencil" in the
record selector. When the user attempts to move to the next record, the
validations will fire off.
 
B

Bunky

Thank you, Scott!
As a matter of fact the validations are in the AfterUpdate event on the
close form button and I want to move them so you have answered two questions
for the price of one!!

Thanks again
 
Top