Hi Corrine
Declare a module variable
mfCancelClose as Boolean.
In you Before Update event do whatever you need as checks and set this
variable accordingly - False if it is okay to close, True if not.
In the Close event set the Cancel param to the value of the variable.
Cancel = mfCancelClose
This is air code but it should work. I use something similar with certain
forms.
Jeff
"Corrine" <cm****@earthlink.net> wrote in message
news:nB*******************@newsread3.news.atl.eart hlink.net...
My form has a Form_BeforeUpdate procedure. If I make a change to a record.
and then click on the Close button, the Form_BeforeUpdate procedure executes
as it should.
1. Is there a way to detect in the Form_BeforeUpdate procedure that the
Close button was clicked as opposed to any other control?
2. Is there a way to stop the form from closing in the Form_BeforeUpdate
procedure after the Close button has been clicked?
Thanks for all help!
Corrine