IIf function

E

Emmy

I have a combo box on a form and based on the choice, I
need to open different reports. Can this be done?

Ex) If I pick "Manager Changed" from the drop down list,
I want to open the report rptManagerChanged. If I
pick "Address Changed" from the drop down list, I want to
open the report rptAddressChanged.

If this can be done, can someone show me an example or
tell me where to look to find this information since I'm
not very experienced writing in code.

Thanks!
Emmy
 
S

SCHNYDES

I use a macro when trying to do this, some use code. Here's my example:

In form design, right click on the combo box and go to properties.
Click on the Other Tab and look at the "Name" Box. To the right you'll see the name of the combobox on the form, usually something like "Combo24."
Jot this name down or remember it. You'll need it for the macro condition.
Then click on the Events tab. Click where is says "After Update." With your cursor blinking here you'll see 3 dots appear to the right of the box, click on that and you'll get another popup with 3 options. Choose the macro builder option, this will take you to a macro scree, which will prompt you to name the macro what you wish, do so and you're ready to begin the macro.
 
E

Emmy

Thanks so much.
-----Original Message-----
I use a macro when trying to do this, some use code. Here's my example:

In form design, right click on the combo box and go to properties.
Click on the Other Tab and look at the "Name" Box. To
the right you'll see the name of the combobox on the
form, usually something like "Combo24."
Jot this name down or remember it. You'll need it for the macro condition.
Then click on the Events tab. Click where is
says "After Update." With your cursor blinking here
you'll see 3 dots appear to the right of the box, click
on that and you'll get another popup with 3 options.
Choose the macro builder option, this will take you to a
macro scree, which will prompt you to name the macro what
you wish, do so and you're ready to begin the macro.
On the top click on View, then Conditions. This will
create another column on the left with Condition as the
header. Here you'll use the combobox we specified
ealier.
In your case, "Manager Changed" is your dropdown
option. In the condition you'll type [Combo24]="Manager
Changed", combo24 being the combobox and Manager changed
being the dropdown choice. To the right of this
condition you can set up your macro. Choose Openreport
as your macro option and select the choices below. Once
you save this, everytime they choose "Manager Changed"
from the drop down, it will either open, print, or send
the report based on the macro action you specified. Hope
this helps, tried not to make it with less coding as
possible.
 
Top