Solved

Hide detail section of report if subreport has no data

Posted on 2014-04-01
3
2,173 Views
Last Modified: 2014-04-01
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
0
Comment
Question by:SteveL13
3 Comments
 
LVL 5

Expert Comment

by:NARANTHIRAN
Comment Utility
Yes its possible..

Turn on Suppress Blank Section in the main report selection..
0
 
LVL 61

Accepted Solution

by:
mbizup earned 500 total points
Comment Utility
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
 

Author Closing Comment

by:SteveL13
Comment Utility
I used the shorthand version.  Thanks.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now