forms and combo boxes

fordy

Registered User.
Local time
Today, 23:39
Joined
Mar 12, 2002
Messages
36
does anyone know how to use a combo box to then go to a form.

eg.
combo box list has three choices

cost form
wages form
insurance form

the operator chooses one which then brings up the form
 
Use DoCmd.OpenForm "FormName" to open a specific form from the AfterUpdate event of your combo box.
Use the search function of this forum and look for matches on: openform event combo

There are a variety of solutions to your question.

Good luck,
David R
 
Do I need to put all the form name in the code "Main form";"second form", if so how is this done
 
Make a multi-column combo box. The first column (after the hidden key column) should be the "pretty name" of your form, i.e. "Insurance Form". The next column, which you'll make hidden (Width: 0") will hold the 'real' name of the form, i.e. "frmInsuranceInformation".

In the AfterUpdate event of your combo box, you can refer to this hidden column as Me.ComboBoxName.Column(2) (they start from 0, not 1).

So DoCmd.OpenForm Me.ComboBoxName.Column(2),[whatever other options you need to set] should open whatever form is selected from your combo box.
Alternatively, you can keep it a regular combo box and use Select Case Me.ComboBoxName and just search out the form that goes with the 'pretty name' you chose. However this is much less dynamic and will cause problems if you need to update things, instead of just going into a lookup table and editing the form information.

Good luck,
David R
 

Users who are viewing this thread

Back
Top Bottom