Results 1 to 3 of 3

Thread: MS Access Reports

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2000
    Location
    Scotland
    Posts
    96
    Hi,

    Different Q this time....

    I can know run access reports from VB but what I would like to do is offer the user a choice from the available ones.

    If I know all the reports then I can just fill up a list box and open the selected one but what I want to do is have an automatic listing ie if a new report is added, it is automatically available and I don't have to go in and add it manually.

    Any ideas?

    Thanks in advance

    Hollie


    Just trying to muddle through...

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    You should be able to use the reports collection in Access or your Access object. It goes something like AccApp.Reports(2).Name or something like that.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Oct 2000
    Location
    Scotland
    Posts
    96

    Angry Whats wrong with this

    Heres my code to generate the list of reports.

    I get nothing out and temp = 0 but I have three reports!!

    can anyone help?

    H.
    Code:
    Private Sub Form_Load()
    ' Initialise list of reports
    
    Dim temp As Integer
    Dim temploop As Integer
    
    Set ErrReport = CreateObject("Access.Application")
    ErrReport.OpenCurrentDatabase "C:\db1.mdb"
    
    temp = ErrReport.Reports.Count
    
    For temploop = 0 To temp - 1
        lstReports.List(temploop) = ErrReport.Report(temploop).Name
    Next
    
    End Sub
    [Edited by Hollie on 11-20-2000 at 04:15 PM]
    Just trying to muddle through...

Posting Permissions

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



Click Here to Expand Forum to Full Width