Any way to print subreports that don't contain records?

  • Thread starter Thread starter Carrie
  • Start date Start date
C

Carrie

Hi,

I have some reports which contain subreports. What they
actually are is applications that need to be sent to a
govt. agency and they have to display all sections, even
if they are empty. I know that subreports don't show up
if there are no records but, is there some way around this
because often there won't be any records in certain
sections?

Thanks a lot
 
Carrie:

The normal way to resolve this is to create a "dummy" copy of your sub
report which does not have a control souce but just contains the labels and
unbound controls that are on your primary sub report. Overlay that on top
of the main subreport, but set the visible property of the dummy report to
false.

Then in the section of the report that contains the sub report add code like
this in the On Format event:

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