The QueryUnload() event is probably what you want. I usually put code such as:
IF !THISFORM.mClose() && Call my own close method
NODEFAULT
ENDIF
in that event. That way, if some code of my own creation returns false (in my forms it's the mClose method. It takes care of things like checking for pending unsaved changes, cleaning up, etc.) then the form will not close (because of the nodefault). Hope this helps.
>Is there an event when a user clicks the X button on a form? Does the destroy event happen everytime a form releases?
>
>Thanks
Brian McCord
President
Sagacity Systems