
Form close event occurs before lost focus event
James
If you're using the LostFocus technique of validation, this is one of
the problems that arises. In the Form_QueryUnload event put all
validation that you want to do (including the hitherto focussed field).
If any failures, display your messagebox and then set Cancel = True
before exiting. This will retain the form.
Regards
{*filter*}
Quote:
>When the user clicks the form close (X), the form disappears before
>the lost focus event of whatever field contained the cursor when the
>form close was clicked. Is this by design or a bug? It causes any
>message boxes displayed by the lost focus event to appear over the
>previous screen that is being returned to, rather than the screen that
>is being closed (which caused the error). Any easy fixes?
>Jim