>How do I perform a check for unsave information b4 closing the application. This is important especially for users who like to close the application by clicking the "X" on the right top corner. Let's say that I still have a few forms opened in my application, and I need to close them , asking for Saving confirmation b4 quiting the main application.
>
>Thanks.
Any form's QueryUnload event has the power to stop the form from closing when the user clicks on the 'X'. When the user tries to close the top-level form or the VFP window by clicking on the 'x' VFP first tries to close all of the child windows. If any fail, the app will not close. To keep a form, and subsequently the app, from closing, issue a NODEFAULT in the form's queryunload event.
Form.QueryUnload:
IF THISFORM.SomethingChanged = .T.
lnAnswer = MESSAGEBOX('Do you want to save your changes?', 3+32)
DO CASE
CASE lnANswer = 6
TABLEUPDATE(.T.,.T.)
CASE lnANswer = 7
TABLEREVERT(.T.)
CASE lnANswer = 2
NODEFAULT
ENDCASE
ENDIF
Erik Moore
Clientelligence