Results 1 to 5 of 5
  1. #1
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919

    Names of all reports in a DB that are NOT OPEN


    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?

  2. #2
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    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.

  3. #3
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    took less time than I thought - about 4 pitches

    Code:
    Sub getClosedReports()
    Dim rpt As Object
    
    For Each rpt In CurrentProject.AllReports
       If rpt.IsLoaded Then Debug.Print rpt.Name
    Next
    
    End Sub
    Seems to work.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  4. #4
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    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

  5. #5
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    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.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 11-26-2017, 12:49 PM
  2. Making Month Names show in query reports
    By jdboss53 in forum Queries
    Replies: 7
    Last Post: 01-04-2017, 05:18 PM
  3. Replies: 3
    Last Post: 06-29-2012, 01:33 AM
  4. Reports and changing the names
    By brobb56 in forum Access
    Replies: 9
    Last Post: 09-21-2011, 03:57 PM
  5. Reports w/ sub-reports very slow to open
    By vaikz in forum Reports
    Replies: 2
    Last Post: 02-27-2011, 08:41 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums