Option for running a certain report

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form that I use to run a report but I want it to be able to choose
which report to run automatically. I have a combo box on the form that has 2
choices in it. When one choice is selected I want it to run a certain report
and when the other is selected it will run the other report. How do I set
something like this up?
 
I have a form that I use to run a report but I want it to be able to choose
which report to run automatically. I have a combo box on the form that has 2
choices in it. When one choice is selected I want it to run a certain report
and when the other is selected it will run the other report. How do I set
something like this up?

DoCmd.OpenReport Me!ComboName, acViewPreview

You can place the above code in the combo box AfterUpdate event (and
it will run as soon as you select the name), or in the Click event of
a Command button (it won't run until you click the command button,
allowing for a change of mind).
 
But how do I specify which report to run? The combo box has 2 options in it
for the users to select. So when they select a certain option that will
trigger a certain report to run.
 
But how do I specify which report to run? The combo box has 2 options in it
for the users to select. So when they select a certain option that will
trigger a certain report to run.

Re: I have a combo box on the form that has 2 choices in it.
Aren't the 2 choices the names of the 2 reports? If not, why not?
 
The two choices are not the reports. They are choices for them to filter the
report. I want the report to be automatically chosen when they select one of
those two choices.
 
But what if there are two reports to choose from depending on what choice
they select from the combo box?
 
Back
Top