Solved Open two forms forms at the same time but only have one visible? (1 Viewer)

Puff

New member
Local time
Today, 22:17
Joined
May 27, 2020
Messages
13
Good afternoon all,

May I ask if it is possible to open two forms (frm_one & frm_two) at the same time but only have frm_one visible until a command button is pressed on that form.

frm_one (which is a pop up) frm_one should then be made invisible and frm_two made visible / editable.

Both of these forms are opened at the same time because a combo box query on frm_one is use to populate frm_two.

frm_one is physically smaller than frm_two and users could click outside of frm_one and cause me problems

A command button on my start screen opens both forms with the following code:

Code:
Private Sub EDIT_Click()
DoCmd.OpenForm "frm_one", acNormal, "", "", , acNormal
DoCmd.OpenForm "frm_two", acNormal, "", "", , acNormal
End Sub
Thank you
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 22:17
Joined
Jul 9, 2003
Messages
11,627
Try:-

Code:
Private Sub EDIT_Click()

Dim strFrmName As String
strFrmName = "frm_one"
    
    DoCmd.OpenForm strFrmName, acNormal
        With Forms(strFrmName)
            .Visible = False
           '.Caption = "I CAN CHANGE THE CAPTION"
        End With

strFrmName = "frm_two"
    
    DoCmd.OpenForm strFrmName, acNormal
        With Forms(strFrmName)
            '.Visible = False
            '.Caption = "I CAN CHANGE THE CAPTION"
        End With

End Sub
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 17:17
Joined
May 21, 2018
Messages
3,183
@Pufff
Your example is not correct in the windowmode argument there is no AcNormal. However there is a AcHidden which you can use to open a form hidden.
The default is acWINDOWNormal
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top Bottom