When does a form lose focus?
I have a point in my routine where I have two forms open at the same time.
Form_1 and Form_2
I want Form_1 to close when it loses focus, so I put the code:
DoCmd.Close in the On Lost Focus event of Form_1 but it doesn't work.
I can move to Form_2 and enter data but Form_1 remains stubornly open.
If I put the the same code in any of the forms field controls On Lost Focus events and move to another field the form closes, so why not when I put it in the Form's own On Lost Focus event.
I can also put code in the On Got Focus event for Form_2 that references Form_1 and close it that way but I am intrigued to know why it won't work From the On Lost Focus event of Form_1
I have a point in my routine where I have two forms open at the same time.
Form_1 and Form_2
I want Form_1 to close when it loses focus, so I put the code:
DoCmd.Close in the On Lost Focus event of Form_1 but it doesn't work.
I can move to Form_2 and enter data but Form_1 remains stubornly open.
If I put the the same code in any of the forms field controls On Lost Focus events and move to another field the form closes, so why not when I put it in the Form's own On Lost Focus event.
I can also put code in the On Got Focus event for Form_2 that references Form_1 and close it that way but I am intrigued to know why it won't work From the On Lost Focus event of Form_1