Focus return to textbox on main form after opening popup

G

Guest

I have a PopUp form that is opened on the OnEnter event of TextBox01 on the
MainForm. What I have discovered is that when the MainForm is initially
opened and I set the focus to TextBox01 which in turn opens PopUp form then
the focus is automatically set back to TextBox01 on MainForm. But ... if
MainForm is already open and a different control has the focus and then I
click in TextBox01, the PopUp opens but the Focus does not return to
TextBox01. Why does the focus return to TextBox01 on the open of MainForm
but not work the same if MainForm is already open and I click TextBox01 from
another control? Note: I do not want to leave the PopUp Form Open all the
time.

Thank you,

Steven

PS: To Dirk Goldgar. Thank you for your help on this last week. Your
suggestion worked part of the way but I could not get the focus back to
TextBox01.
 
G

Guest

I use a separate popup and I have code inside the popup so when it looses
focus it Docmd.Close the popup.

I actually then use a Public Variable called G_Alert and using the SendKeys
Down Arrow function I think I use F9 to close the form and return it to what
ever field I want to send it to by using the form fucntion process inherent
in the db.

FieldName.setfocus

Hope this helps



Dwight
 

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