Combo box to select diffrent form

Muneer

New member
Local time
Today, 00:17
Joined
Jul 17, 2000
Messages
7
Hello great people

How can I make a combo box that show a list of forms names then when select one it will open

Thank you
 
Actually, I posted a question earlier which is very similar to yours. However, I didn't get any reply. Fortunately, I did solve the problem.
What I did is that I created a form with a field name "selection," which contains the "nicknames" for your sub-form. In my case, I had "Products", "category", and "PriceInfo". Create a combo box using the "selection" field of that form.
Then I created the three sub-forms that correspond to the 3 nicknames, "frm_products", "frm_category", "PriceInfo." Then, I dragged the names of the sub-forms onto the "details" part of your form. Make sure you rename the sub-forms after they are placed on your main form under the PROPERTIES-->OTHERS-->NAME field so that they have the same names as your sub-forms.

Then select the combo box. Click on Event-->After_update and bring up the code builder.

Part of the VB code I used is:

Dim sfproducts As SubForm
Dim.........(you just replicate these)

Dim strcbovalue As String

Set sfproducts = Me!FRM_Producs_sub
Set......(replicate for the rest)

strcbovalue = Me!CBOselection
'(CBOselection is the OTHER name for my
'combo box)

sfproducts.Visible = False
(do the same for the rest)

If (strcbovalue = "Products") Then
sfproducts.Visible = True
ElseIf strcbovalue = ......
(do the same for the rest)

End If


Then, everything should works.
 
Thanks for help
 

Users who are viewing this thread

Back
Top Bottom