Check for Condition When Closing a Form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a function that checks for a certain condition on a form. I need to
know where to call the function from so if the user closes the form the
condition check is made, and if it's not met, prevents the form from closing.
I've tested it in various places - onclose, on deactivate etc. - the check
occurs, the message box is displayed, but the form closes leaving the invalid
condition uncorrected.

Any help would be appreciated

Thanks, Dave
 
Dave C wrote in message
I have a function that checks for a certain condition on a form. I need to
know where to call the function from so if the user closes the form the
condition check is made, and if it's not met, prevents the form from closing.
I've tested it in various places - onclose, on deactivate etc. - the check
occurs, the message box is displayed, but the form closes leaving the invalid
condition uncorrected.

Any help would be appreciated

Thanks, Dave

Try On Unload.

But - if this has to do with saving a record, perhaps check the forms
before update event?
 
Back
Top