A
Andrew Coyle
Hi
I have a form with an exit button on it, with the simple command
docmd.CloseForm.
The form also has a BeforeUpdate event, which as part of the code pops a
message box and gets a response from the user.
I would like to use the response from the BeforeUpdate event to determine
whether I should also cancel a later event.
For example, if the user clicks the close form button without saving the
current record, I want to pop a box from the BeforeUpdate event saying do
they want to save the current record Yes No Cancel, and if they click cancel
I want to also cancel the close form event.
I notice that Access puts (cancel as Integer) into the event subroutine
headers, so I was wondering if perhaps that is what I need to use somehow.
Does the DoCmd.CancelEvent set these? and if so, how do I use them?
All help greatly appreciated
A
I have a form with an exit button on it, with the simple command
docmd.CloseForm.
The form also has a BeforeUpdate event, which as part of the code pops a
message box and gets a response from the user.
I would like to use the response from the BeforeUpdate event to determine
whether I should also cancel a later event.
For example, if the user clicks the close form button without saving the
current record, I want to pop a box from the BeforeUpdate event saying do
they want to save the current record Yes No Cancel, and if they click cancel
I want to also cancel the close form event.
I notice that Access puts (cancel as Integer) into the event subroutine
headers, so I was wondering if perhaps that is what I need to use somehow.
Does the DoCmd.CancelEvent set these? and if so, how do I use them?
All help greatly appreciated
A