headings in subreports

  • Thread starter Thread starter Janice
  • Start date Start date
J

Janice

Anyone know how to force the headings of a subreport to print even if the
subreport has no data?

I can't have the headings in the main report as I want them to repeat if the
subreport goes on to a new page...

Thanks in advance,

Janice.
 
Janice:

This is a age old issue. The most common work around is to create a
"dummy" copy of your sub report that just contains the heading you want to
display; have the dummy report unbound to any record source. Then layer
this dummy report over your live sub report and set the dummy sub's visible
property to false.

In the On Print event of the section of the report that contains the sub,
add code like this:

If Me!MyRealSubReportName.Report.HasData = False Then
Me!MyDummySubReport.Visible = True
Else
Me!MyDummySubReport.Visible = False
End if
 
Thanks for your help SA,

Janice.

SA said:
Janice:

This is a age old issue. The most common work around is to create a
"dummy" copy of your sub report that just contains the heading you want to
display; have the dummy report unbound to any record source. Then layer
this dummy report over your live sub report and set the dummy sub's visible
property to false.

In the On Print event of the section of the report that contains the sub,
add code like this:

If Me!MyRealSubReportName.Report.HasData = False Then
Me!MyDummySubReport.Visible = True
Else
Me!MyDummySubReport.Visible = False
End if
 
Back
Top