how to cancel 'close form' action?

A

Alex

hi anyone,

I need to cancel a close form action in my application if
some condition is true..
I want to give a message and leave the form opened, even
though the button "close" was pressed.
How to do it?

thanks in advance.
alex
 
A

Allen Browne

Cancel the Unload event of the form.

Ultimately, there is not a very nice way to achieve this, as you can get
conflicting messages in Form_BeforeUpdate, Form_Error, and Form_Unload
events.
 
Top