Avatar of jonlake
jonlake
Flag 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
Microsoft Access

Avatar of undefined
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?

Thanks anyway for your help.

Jon
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
jmantha709

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?

Thanks, Jon
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
Billystyx

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.