Well I've gotten back to the reporting issues as of late; some other demands took precedence for a while but now I need to get reports going on a regular basis.
I've rethought my reporting methods a little, and while I've found a way that I think will work very well for my needs, I'm having major issues with one thing. I cannot set a subreports filter to the parent report's filter. I just cannot do it.
I have a set of reports, about 10 in total. I have a reporting form which lets the user select a start and end date, and generate a report using those dates. For individual reports this works fine, I use a bit of VBA on the OnClick property of each command button, something like this:
[tt]
Dim stDocName As String
Dim strClause As String
stDocName = "rpt_CbByMap"
strClause = "[cb_dateReceipt] >= #" & rptDateStart & "# AND " & _
"[cb_dateReceipt] <= #" & rptDateEnd & "#"
DoCmd.OpenReport stDocName, acPreview, "qry_RptCbByMap", strClause
[/tt]
BUT, I need one report which contains some of the other reports as sub-reports. I want to select the dates as I normally would, and have the sub-reports filter match that of it's parent filter (the 'main' report).
I have tried Me.Filter = Me.Parent.Filter in the OnLoad and OnPrint events of the sub-reports report and footer areas, tried setting it from the parent report, etc. to no avail. I suspect that it doesn't work because the Filter property cannot be used until the entire sub-report has loaded... but I can't determine a way to resolve this and make it work.