Drop Down Selection Determines Next Action

E

Emma

I have an Access form where we track tasks that we do. I want to be able to
enter details of a particular task when that task is selected from a drop
down list.

For example, if "new contract" is selected from the drop down list, I want
the New Contract Form to open. If, "Consignment" is selected, I want the
Consignment form to open.

How do I code this? OnChange Event?
 
P

PC Datasheet

If you don't have too many of these options, you can use Select Case coding.
Looh it up in the Help file to see how it works. You would put the following
code in the AfterUpdate event of your combobox:
Select Case NameOfCombobox
Case "New Contract"
DoCmd.OpenForm "New Contract"
Case "Consignment"
DoCmd.OpenForm "Consignment"
..
..
..
End Select
 
P

PC Datasheet

You could do it for all 20 items with no problem. If you only needed to open
a form for 5 out of the 20, then you need to do something if any of the
other 15 are chosen. You would just add the following line:
Case Else
<Do this if any if the 15 are chosen>

"Too Many" is hypothetical. Select Case would still wotk if you had hundreds
of choices but in this case you might want to consider doing something
different.
 
Top