>I could try that. But it would seemed like handling the two exits differently. With the CloseEvent() I must check first if the user really wants to quit. If he wants, then will I issue the Release command. While, with the QueryUnload, if the user intends to stay on the session, I'll issue a NODEFAULT to prevent the Unload event to execute. This would make a common routine (like a 'DoBeforeClose()') to check first what called the method.
>
>I can not include this in my CloseEvent()
> Thisform.QueryUnload(),
>since it contains a NODEFAULT statement.
>
>Maybe you could help me with a non-messy routine.
Actually, you may have one common procedure, that will be called from QueryUnload and from all places you call RELEASE Thisform programmatically. The procedure (method) itself could be simple enough:
***Form.DoYouWantToClose
IF Messagebox('Do You Want To Close?',4+32)<>6
Return .f.
ELSE
Return .T.
ENDIF
***Form.QueryUnload
IF This.DoYouWantToClose()=.F.
NODEFAULT
ENDIF
etc.
Edward Pikman
Independent Consultant