The Reports collection only pertains to open reports. How do I find the names of all the reports defined in a DB that are closed?
The Reports collection only pertains to open reports. How do I find the names of all the reports defined in a DB that are closed?
CurrentProject.AllReports is the container for all reports whether loaded or not (AFAIK). So to know if it is open or not you would test the .IsLoaded property. If false, then it's closed. I don't have any code written for that but presume you could handle it. If not, let us know.
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.
took less time than I thought - about 4 pitches
Seems to work.Code:Sub getClosedReports() Dim rpt As Object For Each rpt In CurrentProject.AllReports If rpt.IsLoaded Then Debug.Print rpt.Name Next End Sub
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.
I had the exact same code in my seeking to answer my own question, except my code was missing "CurrentProject.".
Thanks,
Bill
Code:CurrentProject.AllReports
You're welcome. Nice to have an easy one once in a while, yes?
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.