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.
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
'DoCmd.close acReport, obj.Name
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.