There are typically two different ways in which a form is closed.
- Thisform.release
- User clicks the title bar close x box
When the form release method fires it next executes the destroy method, and finally the unload method, whereas when the user clicks the close box, the QueryUnload method executes and if it returns True the destroy method, then unload method fire.
What you can do is in your Release method place a line like:
if not This.QueryUnload
Return .f.
endif
And in the QueryUnload event place code to control whether the form closes or not.
Glenn
>When a user closes a form, DESTROY appears to be the first method fired that I can tell. If I put error checking in there, how can I, with a messagebox, send the user back to the form if they want to fix an error and NOT finish releasing the form? I have been guessing at some possibilities but they all seem to continue on and close the form.