B
Bill Stanton
I'm unable to get a sub-report to function properly
when running as a sub-report. I.e., it will preview
correctly when executed as a stand-alone report,
but as soon as I try to run the sub-report inserted
into the main report, I get a run-time error when
the OnOpen code attempts to set the filter for the
RecordSource, which is a Union Select query.
I've attempted to get the sub-report to inherit the
RecordSource of the main report by setting the
RecordSource of the sub-report to blanks, but
that doesn't work either.
The reason for the sub-report is that it needs to
group differently than does the main. E.g., the
main report groups by "title" and the "title" footer
has a control that displays SUM(Amount) for
each "title". The sub-report groups by "type"
and the "type" footer has a control that displays
SUM(Amount) for each "type".
The OnOpen code for the main report determines
what the RecordSource filter needs to be from
the user when the report is initiated and both the
main and sub-reports need to use the same
filtered RecordSource.
So, the question is: How do I get the sub-report
to use the same RecordSource as the main?
Thanks,
Bill
when running as a sub-report. I.e., it will preview
correctly when executed as a stand-alone report,
but as soon as I try to run the sub-report inserted
into the main report, I get a run-time error when
the OnOpen code attempts to set the filter for the
RecordSource, which is a Union Select query.
I've attempted to get the sub-report to inherit the
RecordSource of the main report by setting the
RecordSource of the sub-report to blanks, but
that doesn't work either.
The reason for the sub-report is that it needs to
group differently than does the main. E.g., the
main report groups by "title" and the "title" footer
has a control that displays SUM(Amount) for
each "title". The sub-report groups by "type"
and the "type" footer has a control that displays
SUM(Amount) for each "type".
The OnOpen code for the main report determines
what the RecordSource filter needs to be from
the user when the report is initiated and both the
main and sub-reports need to use the same
filtered RecordSource.
So, the question is: How do I get the sub-report
to use the same RecordSource as the main?
Thanks,
Bill