>Can you run code when the user clicks on the Close button (the X) when Form.Closable = .t. I want the close button to function like my Cancel button, which runs some exit code and releases the form. Can this be done with the close button, or do I have to settle for setting Form.Closable = .f. and rely solely on my Cancel button?
You can put code in the forms QueryUnload method. That way, you can check if there is any condition that should prevent the closing of the form and stop it with a NODEFAULT. If you don't have any reason to stop the close, you can put the code in the forms Destroy method.