Drop down box to select report to run

Benson112

Registered User.
Local time
Today, 01:54
Joined
Apr 17, 2008
Messages
21
Hi there,

I want to create a drop down box on my form with a list of reports to run however I am struggling!!!

I have managed to create the drop down list (combo box thingy) which I have entered the names of the reports as items on the drop down but I am struggling to get access to run the corresponding report when an item is selected.

Can anybody help as to how i assign a report to each item in the list or even better, an easier way to do this?

Thanks!
 
How have you filled the combobox? Did you put the data into a table or did you hardcode the list into the combobox?
 
When you create the combo box it gives you the two options doesnt it, "I was to lookup the values in a table or query" or "I want to type in the values myself" (or something along those lines)

Because I dont havea table or query to lookup the values from, I typed them in myself. Now im stuck as to how to get each option to run a different report.
 
Well the easiest way is to "translate" the data you entered into the combobox into your report names (somehow)

You can do this 2 ways
1) Hardcoded (Hardcoding is seldom a perfect solution)
Like you hardcoded the combobox using IF statements in your code.
Or
Enter the report names into the combobox, hidden from the user, but available to coding :)

2) Table oriented (better way)
Enter your list into a (small) table, add to this table a second column with the report name you want to open if this option is chosen.
Now you can add/remove/change things on the fly without touching your code :)
 
Thanks for your reply namliam....however I am still completely lost. Not your fault in the slightest its me, im a complete novice with access and dont know what any of that means! lol

Id rather do it the "better way" soooo...

Ill give you a brief overview of what I am trying to do. I have 10 or so reports for outstanding incidents for each team within our department, I want the drop down list to display:

Outstanding incidents for: (drop down list here) and when a team name is selected in the drop down list it runs the report.

I have gone to create a table in datasheet view. Do i just list the team names here and save the table?

Then go to my form in design view, create a new combo box, use the table ive created to populate it. Have 2 columbs.....

Then what?

Thanks again for your help, sorry im such a dumbass!
 
:eek:

Thanks again for your help, sorry im such a dumbass!
No need to say sorry and you are probably no dumbass...

If you want to basicaly run the same report for different teams... Then there is no need to create 10 reports... Just have one...

Each report probably has something in the query to limit the team name/number for this report. "Simply" add this limitation to the "filter" part of your Docmd.Openreport command.
You can then "add" the team name/number to the Filter from the drop down box and you are done :D


Look up the Openreport command in the help, see how far you get and post back any questions :)
 
Thanks for your help mate, ive managed to do what I wanted now.

I found a table that had the group names in that i wanted so i managed to get the query to run from the selection.
 

Users who are viewing this thread

Back
Top Bottom