Controlling Visibility of a Subreport

J

JohnB

Hi. Is it possible to have some ON Print code in a
Reports Header section that makes a Subreport visable
only if certain other criteria are met?

For example, say I have fields txtSubject and txtYear in
a reports StudentID header, plus a subreport called
rptStudentSubreport. Can I add On Print event code to
this header that makes the subreport appear only when the
content of txtSubject is ECS and the content of txtYear
is Yr4?

Is this possible and if so what would the code look like?

Thanks in advance, JohnB
 
M

Marshall Barton

JohnB said:
Hi. Is it possible to have some ON Print code in a
Reports Header section that makes a Subreport visable
only if certain other criteria are met?

For example, say I have fields txtSubject and txtYear in
a reports StudentID header, plus a subreport called
rptStudentSubreport. Can I add On Print event code to
this header that makes the subreport appear only when the
content of txtSubject is ECS and the content of txtYear
is Yr4?

You need to use the Format event for this kind of thing.

Me.subreportcontrol.Visible = (Me.txtSubject = "ECS") _
And (Me.txtYear = "Yr4")
 
J

JohnB

Thanks for this Marsh. Ill take some time to look at the
Format event - I have no knowledge of it. Ill get back to
you if I have any problems with your suggested code.
Thanks again, JohnB
 

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