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

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
 
S

SA

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
 

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