Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CAN I OPEN DIFFERENT FORMS FROM 1 COMBO BOX

Status
Not open for further replies.

zachsiue

Technical User
Jan 9, 2003
20
US
Hi,

I would like to set up a combo box so that when a user selects an item from the box, a form specific to that item will be opened. Is this possible? If so what code would I need to implement this?

i.e.
On a form called Main,
cboExample contains the following entries: ItemA, ItemB, and ItemC.

If ItemA is selected, FormA is opened.
If ItemB is selected, FormB is opened.
If ItemC is selected, FormC is opened.

I have only worked with access for a couple of weeks, so if there is a way to do this please be explicit.

Thank You!!

Zach
 
Simple - In the properties of the combo-box, make an after_update event and select code builder. In the code, add something like below, only customized to your names:

------------
Select Case [ComboBoxName]
Case "Selection1"
DoCmd.OpenForm "SomeFormName"
Case "Selection2"
DoCmd.OpenForm "AnotherFormName"
Case "Selection3"
...
End Select
------------
 
THANK YOU!!!!!
It worked wonderfully!! After finishing that, I came up with another question. Is is possible to open a form using the outcome of two combo boxes? I guess I'm getting greedy, but if its possible it would make life alot easier!!

Thank you so much!!

Zach

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top