Form close event occurs before lost focus event 
Author Message
 Form close event occurs before lost focus event

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



Mon, 21 Aug 2000 03:00:00 GMT  
 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



Tue, 22 Aug 2000 03:00:00 GMT  
 Form close event occurs before lost focus event


says...

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

 I believe when you close formA screen.activeform.name is no longer formA. If
in the top of the lost focus event of your textbox you exit sub if  
screen.activeform.name <> formA.name, this should work.

HTH,
Mike



Tue, 22 Aug 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. lost focus event occurs when user selects menu option

2. checking for click event during lost focus event

3. MDI child forms and control lost-focus events

4. Disabling event when form has lost focus

5. lost focus and got focus event

6. I need an event to occur on a Frame when a contained control receives focus

7. CommandBarComboBox Change event (content not saved when losing focus)

8. Lost focus event combo box

9. Force lost focus event to text box

10. Help! Getting Extra Lost Focus() events

11. Lost Focus Event (HELP!)

12. lost focus event problem when using access keys

 

 
Powered by phpBB® Forum Software