confusing help file! Please Help! :)

cyberz

New member
Local time
Today, 07:09
Joined
Sep 10, 2002
Messages
7
from access help:

"Note To list all reports in the database, whether open or closed, enumerate the Documents collection of the reports' Container object. You can then use the Name property of each individual Document object to return the name of a report."

can anyone explain to me what this means and how to do it?

Thanks!

Martin
 
Using the Reports collection, you can only view OPEN reports. This collection enables you (or the user) to retrieve information on all reports in the database whether open or closed.

What are you trying to do?

The following code will display a message box with the name of every report in your application.

Dim obj As AccessObject, dbs As Object
Set dbs = Application.CurrentProject

For Each obj In dbs.AllReports
MsgBox obj.Name
Next obj

You could also use this code to populate a combo box with all available reports names...

Dim obj As AccessObject, dbs As Object
Set dbs = Application.CurrentProject

For Each obj In dbs.AllReports
cboReportList.AddItem obj.Name
Next obj

Hope this helps!
 

Users who are viewing this thread

Back
Top Bottom