Empty subreport

  • Thread starter Thread starter Mei Qin
  • Start date Start date
M

Mei Qin

Hello,

I have a main report contains 8 subreports. The main
report is just the place holder with some header
information. I want to display each subreport on a new
page. This works fine when subreport has data. But it give
me a empty page when a subreport with no data. How can I
get rid of this empty page when there is no data on a
subreport?

Thanks for any help!

Mei
 
Name your page break controls so you can refer to them in code. Then use
code like:
Me.pgbrkOne.Visible = Me.subrptOne.Report.HasData
 
Hi Duane,

Can you tell me in which event of the report I can use
your code. The Open event throws back errors when I use
it there.

Great idea - I could use this in a lot of places in my
application!
 
Duane,
Is there a way to change the SourceObject based on whether there is data or
not? I have 2 sub-reports, one that has the field headers and the data, and
one that has the field headers and a textbox with the caption of "NONE". If
ther is no data I want the "NONE to print.

Dwight
 
Got it!

If Me.rptJoint.Report.HasData Then
Me.rptJointNone.Report.Visible = False
Me.rptJoint.Report.Visible = True
Else
Me.rptJointNone.Report.Visible = True
Me.rptJoint.Report.Visible = False
End If

Thanks
 
Back
Top