group header not with report header?

  • Thread starter Thread starter dkingston
  • Start date Start date
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
 
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.
 
Back
Top