By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,214 Members | 1,516 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,214 IT Pros & Developers. It's quick & easy.

Form_BeforeUpdate procedure

P: n/a
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
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.