>I wish to trap the exitting of the form so that I can prompt the user to confirm ending the transaction. If they select "no", I do not want to close the form. Note that I want this message to appear if they click the close button (in the top right corner of the window) or if they click a "cancel" button that I've placed on the form. How do I do this?
>
>Thanks,
Ronald, you should use form QueryUnload to place the confirm code.
Issue NODEFAULT and return .F. from this method if the user chooses "No". In your Cancel button you need to call the form.QueryUnload() method before you do Release() the form.
It may look like:
*cmdCancel.Click()
IF thisform.QueryUnload()
*... do something
thisform.Release()
Nick
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro
"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison