Addressing groupings on subreports from a main report

G

Guest

This message was inadvertantly posted to the General Access newsgroup
earlier, so I'm reposting it here. My apologies.

I have created two subreports on a main report to address the issue of
different groupings in two different sections of a report. Now I have a
followup issue.

How do I now refer to controls on subreports? To be more specific: I give
the user the option to view summary or detail. If they indicate "summary", I
make all the "interior" groupings invisible, and vice versa. And, I also
collect parameters (begin and end date) which the main record source and a
whole group of "totals" queries employ in presenting the final report.

With two subreports on a main report, how do I now address the groupings in
the subreports and universally apply the collected parameter?

Regarding the groupings on the subreport: on the Open Event of the main
report I want to hide or show groupings on the subreports.

I have tried:
Reports!subreportcontainername!groupheadername.visible = true|false
Reports!subreportcontainername!subreportname!groupheadername.visible =
true|false
Reports!subreportname!groupheadername.visible = true|false
Me!subreportcontainername!groupheadername.visible = true|false
Me.subreportcontainername!groupheadername.visible = true|false
Me.Controls("subreportcontainername").visible = true|false
...and several other variations

and none of them work. How do I talk to the subreport!?

I have not gotten as far as universally applying the collected parameter,
since I haven't yet solved the above issue.

Thanks in advance for your help.
 
M

Marshall Barton

Darrell said:
This message was inadvertantly posted to the General Access newsgroup
earlier, so I'm reposting it here. My apologies.

I have created two subreports on a main report to address the issue of
different groupings in two different sections of a report. Now I have a
followup issue.

How do I now refer to controls on subreports? To be more specific: I give
the user the option to view summary or detail. If they indicate "summary", I
make all the "interior" groupings invisible, and vice versa. And, I also
collect parameters (begin and end date) which the main record source and a
whole group of "totals" queries employ in presenting the final report.

With two subreports on a main report, how do I now address the groupings in
the subreports and universally apply the collected parameter?

Regarding the groupings on the subreport: on the Open Event of the main
report I want to hide or show groupings on the subreports.


The only place that you can set subreport properties is in
the subreport. E.g. the subreport's open event could be:

Sub Report_Open(. . .
Me.Section(5).Visible = Not Forms!someform.checkbox.Value
. . .
End Sub

If you don't want the subreport to be aware of the form
references, find a place to place the information needed to
make the decisions. A handy place to park the info might be
in public variables in the main report's module. E.g.
Public IsSummary As Boolean
Sub Report_Open(. . .
Me.IsSummary = Forms!someform.somecheckbox

The subreport can refer to the main report variable
Me.Section(5).Visible = Not Parent.IsSummary
 
G

Guest

Thank you so much, Marsh! That settles the issue once and for all. I will
have to do as you suggest and "park" the information (probably as properties
in a class module).

This will inform all my future design as well.

Thanks again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top