Form Before update interferes with other procedures

  • Thread starter Thread starter Sammy
  • Start date Start date
S

Sammy

I have a before update procedure on a form which fires
during other procedures, such as a close form button and
a save record button. If the conditions of the before
update procedure are met, I want to cancel any other
procedures which may be running. What is the code to do
this? Does the code go in the form before update
procedure, or on the procedures that I want to cancel?
Thanks!
 
If you cancel Form_BeforeUpdate, Access pops up a message asking the user if
they really want to close the form (and lose their entry), or if they want
to stay with the edit. It may not be idea, but it works better than most
alternatives. If you lock it down too tight, a user is likely to switch off
their computer without exiting properly, and the result is a corrupted
database file.

If you want to trap the message about the closing of the form, you can do so
in the Error event of the form.

If you want to prevent the user from closing the form, you can cancel the
Unload event of the form.
 
Back
Top