I have a report with nested subreports (subreport in subreport of original report). Sometimes I want to filter the innermost subreport by a date range and sometimes I don't.

Instead of creating two reports (one with filter, one w/o) I am trying to manipulate the Filter property with code in the original report. I keep getting errors saying I can't do that. I have placed the code in Report Open event, Detail Format event and just about all other events.

I then tried to change the RecordSource of the innermost subreport via code in the original report, again no success.

Does anyone have any suggestions how to be able apply a filter or change RecordSource of a subreport via code in the original report?

I am using Access XP.