Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2002
    Posts
    17

    Unanswered: Return names of all existing reports in database?

    Is there a way to return the names of all existing reports in a database. Does somebody have a module for this?

    Thanks!

  2. #2
    Join Date
    Aug 2002
    Location
    Northampton, England
    Posts
    266
    Place this line of code in the Row Source of a list box.

    SELECT MsysObjects.Name FROM MsysObjects WHERE (((Left$([Name],1))<>"~") AND ((MsysObjects.Type)=-32764)) ORDER BY MsysObjects.Name;

    David

  3. #3
    Join Date
    Aug 2002
    Location
    Québec, Canada
    Posts
    109
    If you seek code and don't want to use SQL, Reports name are already in a collection:

    Code:
    Public Sub ShowAllReports()
        
        Dim x As Integer
        Dim strAllReports As String
        
        strAllReports = ""
        With CurrentDb
            MsgBox "There is " & .Containers("reports").Documents.Count & " report(s) in that database"
            
            For x = 0 To .Containers("reports").Documents.Count - 1
                strAllReports = strAllReports & .Containers("reports").Documents(x).Name & vbCrLf
            Next x
            
            MsgBox strAllReports, vbInformation, "List of all report(s) name(s)"
        End With
            
    End Sub
    JefB

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •