
Do you want to save the changes? yes No and CANCEL
Quote:
> LS
> I have the following problem with MS Access. I have added the code in the
> BeforeUpdate event: "Do you want to save the changes? " With the buttons yes
> no and cancel.
> The cancel button does not behave the way i like. When I press Cancel, I
> would like to stop all other events are processes and return to the form
> without changing anything. So temporary changes stay on the form.
> For example:
> I press the close button. The message "Do you want .. " appears from the
> BeforeUpdate event, pressing cancel does not make the close command stop. So
> the form is closed anyway. I would like the form to return to the form
> without doing anything.
> Please Help Me,
> Frank
Hi Frank,
on the last project I had to solve a similarly problem:
On before Update, the had to be some cross checking and depending on the result
the update had to be canceled or continued.
When the before Update starts, the db-Engine allready introduced the process of
updating the database.
This process must be stopped. And that cannot be done by simply exit out of the
sub.
in addition you have to tell the engine to cancel the update process.
this will be done by the command:
DoCmd.CancelEvent
insert this commend to the point where you want to break out of the process and
your problem should be solved !
Good luck
Michael