headings in subreports

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.
 
S

SA

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
 
J

Janice

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
 

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