triggering an event when focus moves from a subform to a main form

P

Paul James

I'd like to run some VBA code when the focus moves from a particular text
box control in a subform to any control in a main form. I've been trying
every possible event in the main form, the subform, and the subform control
I can think of, and nothing seems to work. For example I've tried

On Exit and On Lost Focus for the subform control;
On Deactivate and On Lost Focus for the subform, and
On Open, On Load, On Activate, On Got Focus and On Click for the main form.

None of these run the code when I click on any control in the main form
after the focus had been on that subform control.

Can anyone tell me what event procedure (and for which object) I can use to
run my code whenever the focus moves from that subform control to any
control in the main form?

Thanks in advance,

Paul
 
G

GVaught

Exactly what are you trying to accomplish once the focus moves from that
particular text box?
Popup a message?
Change the color of the Main form controls?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top