How to set the focus? (1 Viewer)

cheberdy

Member
Local time
Today, 19:48
Joined
Mar 22, 2023
Messages
77
I have a menu with which I can navigate between forms. When I open one of the forms I would like to have it in the foreground and not in the background.
How to do this?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 10:48
Joined
Oct 29, 2018
Messages
21,538
You could try using popup forms or open it in dialog mode.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 13:48
Joined
Feb 19, 2002
Messages
43,484
If you are having trouble with this, you are already using popups. Try NOT using popups. What I do is to hide the calling form because having multiple forms open at one time just causes confusion and if you don't use dialog mode, the user can update data on multiple forms and forget what record he is really working with - dangerous.

I pass in the name of the current form:

Code:
    DoCmd.OpenForm "form name", , , "where condition", , acDialog, Me.Name
    Me.Visible = False

Then, the called form uses the OpenArgs to reopen the calling form.

Code:
IF Me.OpenArgs & "" = "" Then
    'open the switchboard
Else
    DoCmd.OpenForm Me.Name
End IF
 

Users who are viewing this thread

Top Bottom