I have code which minimizes the MS Access application upon opening and then opens a Login form. My problem is that I cannot get the focus automatically to the User ID field in the login form. For some reason the focus appears to remain on the minimized application until I physically clisk in the User ID field. The minimize code is:
Screen.Application.RunCommand acCmdAppMinimize
This works well but to perfect things I would like the focus to then be on the User ID field so that 'Users' can start typing instead of having to first clisk in the User ID field.
All help gratefully received.
Jon
Microsoft Access
Last Comment
Billystyx
8/22/2022 - Mon
Calvin Brine
Here's what I do.
Use the tools....Startup from the menu.
From the startup you can assign what menu's are available to the user.
Then add a password to the database.
It can still be bypassed by typing in the password, holding the left shift and hitting OK.
jmantha709
If your login form is part of your Access Database, then to set the focus on it, you can't Minimize the application...
jonlake
ASKER
Ummm... my login is an integral part of the database. Maybe I'll have to put up with the mild inconvenience of having the user 'click' into the UserID field before they can start logging-in?
I don't quite undestand why you wan't to minimize Access if you want to show a form ?
Billystyx
On the oncurrent event of the startup login form, put this line of code
DoCmd.RunCommand acCmdAppMinimize
and make sure that the tabindex for the USERID field is set to 0. It works for me.
jonlake
ASKER
Hi, DoCmd.RunCommand acCmdAppMinimize works to minimise the application but the focus does not move to the UserID field. Can a similar function force all open windows to be minimised?
Use the tools....Startup from the menu.
From the startup you can assign what menu's are available to the user.
Then add a password to the database.
It can still be bypassed by typing in the password, holding the left shift and hitting OK.