Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reports from a Listbox 1

Status
Not open for further replies.
Jul 4, 2004
42
GB
Hello.

One of our databases has over 100 printable reports each triggered by a button on a form. As you can imagine having over 100 buttons on one page makes for a full page and we have been asked to produce another 25. We dont really want to have multipal forms with buttons.

I have seen databases where the reports are selected from a "list box", so you highlight e.g."report No 5" and use a button which prints it. I cant find anything on the internet on how you attach reports to a list box.

Can anyone help

Thanks in advance.

John
 
What I would do is to create another table with your list of forms, then create another form linking to that table.

Then have a sub-form with a scroll box instead of a list box.

I got this template from MS website and i think it has what you are looking for in the reports section.

 
Create your listbox, set the Row Source type to Table/Query, and set the Row Source property to...

Code:
SELECT msysobjects.Name, msysobjects.Type FROM msysobjects WHERE (((msysobjects.Type)=-32764));

Then, in the code behind your "Run Report" button, try something like this...

Code:
DoCmd.OpenReport Me.lstReports.Value
 
Hi I was looking for something similar and found this, it will need some alteration but it will give you somewhere to start.

thread702-1046082
 
Or use rjoubert's method as it works great :)

remember to call your listbox "lstReports"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top