Data validation

  • Thread starter Thread starter E. Kwong
  • Start date Start date
E

E. Kwong

Newbie question:
I have a simple form in which there are several required
fields user has to fill in. The validations are all done
in the form's BeforeUpdate event.

Everything works fine if user hit the exit button upon the
last record entry. However; some users tend to click the
next-record button after they add a bunch of records, then
click the exit button on the blank form to exit. At that
point message box from the first validation rule pops up,
and then Access will give them one more pop-up and allow
them to exit. Is there any way to get around this and
allow a more 'graceful' exit?

Thanks,
 
Simply going to a new record should not cause this behaviour.

Do you have some code that is automatically dirtying the record as soon as
the user goes there? If so, that is the problem.
 
Use a conditional statement in the close event of the form If Me.NewRecord
then Exit Sub, and upon the last required fields AfterUpdate event set the
Me.Dirty = False property of the form
 
Back
Top