V
Vexen Crabtree
The user can have multiple non-modal, restored, forms open at once and can
switch between them as they want, often by just clicking on their titlebars.
These forms are all instances of F_URL. I am using Vista, Access 2007.
How do I run a routine anytime the user switches form?
F_URL.GotFocus doesn't fire because the Focus event only fires for the
particular control that has the focus on the form, and, there are many such
possible controls. F_URL.Activate doesn't fire.
So, four possibilities as far as I can see:
1. There is probably some obvious event that I'm just missing!
2. If not, how do people get around this? One way I've thought of is using a
timer but it seems an incredible use of resources to have it run (say) every
500ms to detect the active form, see if it has changed since the last time
the code was ran, and then to run it. And... I'd have to have a hidden form
permanently open to actually run the timer. Is there a better way?
3. Should F_URL.Activate be firing when the user switches form? I've checked
(and stepped-through) the app looking for anything that might interfere with
..Activate but there doesn't seem to be anything.
4. I *could* have a button on each form that the user clicks in order to run
the code after they've switched form. But I know that they'll forget, won't
see the point, and will complain about having to do it!
Does anyone have an *elegant* way of detecting when the user has switched
between already-open forms?
switch between them as they want, often by just clicking on their titlebars.
These forms are all instances of F_URL. I am using Vista, Access 2007.
How do I run a routine anytime the user switches form?
F_URL.GotFocus doesn't fire because the Focus event only fires for the
particular control that has the focus on the form, and, there are many such
possible controls. F_URL.Activate doesn't fire.
So, four possibilities as far as I can see:
1. There is probably some obvious event that I'm just missing!
2. If not, how do people get around this? One way I've thought of is using a
timer but it seems an incredible use of resources to have it run (say) every
500ms to detect the active form, see if it has changed since the last time
the code was ran, and then to run it. And... I'd have to have a hidden form
permanently open to actually run the timer. Is there a better way?
3. Should F_URL.Activate be firing when the user switches form? I've checked
(and stepped-through) the app looking for anything that might interfere with
..Activate but there doesn't seem to be anything.
4. I *could* have a button on each form that the user clicks in order to run
the code after they've switched form. But I know that they'll forget, won't
see the point, and will complain about having to do it!
Does anyone have an *elegant* way of detecting when the user has switched
between already-open forms?