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

How do I iterate through closed reports in an ADP?

Status
Not open for further replies.
Jun 25, 2003
31
GB
Access (bless its heart) has corrupted my database, and none of my (100s of) reports now have any input parameters.

I want to do something like this:
Code:
Private Sub cmdDoIt_Click()
Dim r As Report
    For Each r In Reports
        If r.InputParameters <> &quot;&quot; Then
            Debug.Print r.InputParameters
        End If
    Next r
End Sub

... but that only lists open reports. I want to get at the list of reports that you can see in the database window.

Anyone got any ideas?

I originally put this on the Access Forms forum and JeremyNYC suggested msysobjects, but I don't know if that's appropriate (and if so how to get at it) in an ADP.

Ta,

JamesH@sunsail.com
 
Here is the example directly from the Help.

Sub AllReports()
Dim obj As AccessObject, dbs As Object
Set dbs = Application.CurrentProject
' Search for open AccessObject objects in AllReports collection.
For Each obj In dbs.AllReports
If obj.IsLoaded = TRUE then
' Print name of obj.
Debug.Print obj.Name
End If
Next obj
End Sub
 
That did it. Thanks.

If anyone is interested, I have expanded on that so that I can go through any property of all objects in one ADP, and write the results to a table, and then do the same in another ADP, writing the results to a different column of the same table (keyed on the object name), so that I can see what's changed between the two.

It's a bit clunky, but awfully quicker than the alternative (like, in which of these 100 reports have the Input Parameters changed from that release to this?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top