D
David Anderson
In an Access 2000 application, I have a main form (RegForm) that opens a
popup form in certain specified circumstances. I want the focus to return to
a control (SurnameCombo) on the main form as soon as the popup has displayed
the required data, while leaving the popup open. However I am having trouble
making this focus switch happen automatically.
Just as an experiment, I attached the following code to a temporary command
button on the Popup form and it works fine.
Forms![RegForm].SetFocus
Forms![RegForm]![SurnameCombo].SetFocus
However, if I use the same code on a variety of the Popup form's events
(i.e. Open, AfterUpdate and GotFocus), nothing happens. Focus remains with
the Popup form. Note that RegForm is already open.
No doubt I am making a very basic error (probably related to the Popup form
not yet being ready to relinquish focus). Any suggestions?
David
popup form in certain specified circumstances. I want the focus to return to
a control (SurnameCombo) on the main form as soon as the popup has displayed
the required data, while leaving the popup open. However I am having trouble
making this focus switch happen automatically.
Just as an experiment, I attached the following code to a temporary command
button on the Popup form and it works fine.
Forms![RegForm].SetFocus
Forms![RegForm]![SurnameCombo].SetFocus
However, if I use the same code on a variety of the Popup form's events
(i.e. Open, AfterUpdate and GotFocus), nothing happens. Focus remains with
the Popup form. Note that RegForm is already open.
No doubt I am making a very basic error (probably related to the Popup form
not yet being ready to relinquish focus). Any suggestions?
David