Link to home
Start Free TrialLog in
Avatar of jonlake
jonlakeFlag for Guernsey

asked on

Minimize Application - Focus on Form

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
Avatar of Calvin Brine
Calvin Brine
Flag of Canada image

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.  
Avatar of jmantha709
jmantha709

If your login form is part of your Access Database, then to set the focus on it, you can't Minimize the application...
Avatar of 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?

Thanks anyway for your help.

Jon
I don't quite undestand why you wan't to minimize Access if you want to show a form ?
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.
Avatar of 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?

Thanks, Jon
ASKER CERTIFIED SOLUTION
Avatar of Billystyx
Billystyx

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial