GK in the UK
Registered User.
- Local time
- Today, 23:53
- Joined
- Dec 20, 2017
- Messages
- 274
I have a login form which opens to the user name field which is what I want.
On login, it opens a menu form and closes itself.
When we log out, it opens the login form and the menu form hides.
But on subsequent opens the focus goes to the Access object list. I have to click in the user name field.
I tried this (SetFocus) in the menu form but focus still goes to the Access object pane:
How can I get focus back to the opened form ?
On login, it opens a menu form and closes itself.
When we log out, it opens the login form and the menu form hides.
But on subsequent opens the focus goes to the Access object list. I have to click in the user name field.
I tried this (SetFocus) in the menu form but focus still goes to the Access object pane:
Code:
Private Sub cmdLogout_Click()
LogUserOut
DoCmd.OpenForm (gstrFrmLogin)
Forms(gstrFrmLogin).SetFocus
Me.Visible = False ' frm_menu (this form) is intended to never close, mSessionID is retained in here
'DoCmd.Close acForm, Me.Name
End Sub
How can I get focus back to the opened form ?