Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2004
    Location
    Chicago
    Posts
    21

    Question Unanswered: Determine active subreport

    Is there a way to determine which subreport is printing or active? I have a main report with three subreports. I want to write the page number that the first page of each subreport falls on to a table to use later for a table of contents. I thought I might be able to use something like an OnPrint for each subreport with a boolean to say if the page was already written, but I found that subreports don't have any event properties, so I'm going to try it in the detail section of the main report.

  2. #2
    Join Date
    May 2005
    Posts
    1,191
    Whoops, wrong thread. Sorry
    Me.Geek = True

  3. #3
    Join Date
    May 2003
    Location
    Dallas
    Posts
    817
    Provided Answers: 5
    i wrote this function to close any report that was open - I commented out the close and place a message box for you - that wil handle what report is open
    also - this is older object model I think you can use allreports instead of application.reports

    Public Function endReports()
    Dim obj As Object
    For Each obj In Application.Reports
    msgbox obj.name
    'DoCmd.close acReport, obj.Name
    End Function
    Dale Houston, TX

  4. #4
    Join Date
    Jan 2004
    Location
    Chicago
    Posts
    21
    Not quite. That didn't work. A picture is worth a thousand words so I'm attaching a screenshot of the design of the report. You'll see it's one report with three similar subreports. I want to capture the page number each subreport starts on within the main report. I also thought I might try a section for each subreport and write the page number when that section printed but sections are data dependant. This main report doesn't have a data source.

    Thanks for any help!
    Attached Thumbnails Attached Thumbnails report.JPG  

Posting Permissions

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