Data validation

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,
 
A

Allen Browne

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.
 
B

Bill Taylor

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top