Hide detail section of report if subreport has no data

On a report in the detail section I have a sub-report.  If there is no data in the sub-report I want to hide the detail section record.

Can this be done?

--Steve
SteveL13Asked:
Who is Participating?
 
mbizupConnect With a Mentor Commented:
Add the following to your Detail Format event in the main report:

    If Me.MySubReportName.Report.HasData = False Then Me.Detail.Visible = False

Open in new window


Or this (shorthand):

    Me.Detail.Visible = Me.MySubReportName.Report.HasData

Open in new window

0
 
Naranthiran DCommented:
Yes its possible..

Turn on Suppress Blank Section in the main report selection..
0
 
SteveL13Author Commented:
I used the shorthand version.  Thanks.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.