group header not with report header?

D

dkingston

I have a main report which contains multiple (5)
subreports. I have set the "Repeat Section" property of a
group header in each of the subreports to "Yes" to repeat
the header on subsequent pages in the main report.
I want a different header to appear on the first page for
each subreport within the main report. Does anyone know
how I can do this?
I suspect that I can use the report header in the sub-
report but can't figure out how.
Please reply via post or to:
d k i n g s t o n (at) j a g l y n n (dot) c o m
 
M

Marshall Barton

dkingston said:
I have a main report which contains multiple (5)
subreports. I have set the "Repeat Section" property of a
group header in each of the subreports to "Yes" to repeat
the header on subsequent pages in the main report.
I want a different header to appear on the first page for
each subreport within the main report. Does anyone know
how I can do this?
I suspect that I can use the report header in the sub-
report but can't figure out how.


First, you have to know when you're in the first instance of
the group header. This can be done by add ing a detail
counting text box (let's name it txtDetailCnt) to the
subreport's detail section. Set its control source
expression to =1 and RunningSum to Over Group. Then the
group header's Format event can use code like:

If txtDetailCnt = 1 Then
' First time header
Me.somecontrol.Visible = True
Me.othercontrol.Visible = False
Else
' repeated header header
Me.somecontrol.Visible = False
Me.othercontrol.Visible = True
End If

to change the visibility of controls so the first header of
a group looks different from subsequent headers.
 

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