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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reports

Status
Not open for further replies.

notreconised

Technical User
Jul 21, 2002
14
0
0
GB
How can i open a reports using a combo box on a form
 
Hi

Summary - you populate the combo box with a list of reportnames, then in after upadte event you put docmd.openreport cboReport,...etc

you can get a list of report names in code from the documenst collection:

Sub DocumentList()
Dim dbs As Database, ctr As Container, doc As Document

' Return reference to current database.
Set dbs = CurrentDb
' Return reference to Forms container.
Set ctr = dbs.Containers!Reports
' Enumerate through Documents collection of Reports container.
For Each doc In ctr.Documents
' Print Document object name
Debug.Print doc.Name
Next doc
Set dbs = Nothing

End Sub

with which to populate your combo box, but you may wish to consider having a table to hold the report names, so that you can have both 'programmer' names (eg rptMyReport) and User friendly names (eg Weekly Sales Report).

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
kenneth.reay@talk21.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top