>I have a form that is set as closable. When Close from the title bar is selected or the 'X' is chosen from the title bar the form processes the control validations. I have a 'cancel' command button and that works fine when I check for Lastkey() in the valid methods. What do I need to do to bypass the valids when trying to close from the title bar.
>
>Thanks
Call the commandbutton's click method from the Form.QueryUnload event. Better yet, create a form method that runs your validation code, and call it form both the cancel button's click and the QueryUnload event. Note- Issuing a NODEFAULT in the QueryUnload event prevents the form from closing.
Erik Moore
Clientelligence