• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1321
  • Last Modified:

Can't get blank record sub-reports to show in Access 2010

I have a main report that is a container which holds sub reports run by separate queries.

If a sub report has no records it doesn't show up in print preview, only in report view and therefore exports to pdf with missing sub- reports.  The sub-reports are designed to show the message "Nil report" which is important for our auditing process.

I have gotten around this problem in other reports by creating queries which creates fake records...but statusing them and then deleting these records become a nightmare to manage and I figure there must be a better way.

I read the following solution from a similar question, but can't get it to work because I don't understand what to put where:


You can also use the subreport's .HasData property. For example, create a textbox (also with .CanShrink) with this expression:

    = IIf(subObject.Report.HasData,Null,'No Data!')

This will show the message instead of the empty report.

Any help on the above or a different solution would be appreciated.
0
grmcra
Asked:
grmcra
1 Solution
 
Rey Obrero (Capricorn1)Commented:
try changing this

  = IIf(subObject.Report.HasData,Null,'No Data!')


with


  = IIf(Report![NameofsubReportControl].Report.HasData,Null,'No Data!')




NameofsubReportControl is the name of the control holding the subreport.
0
 
grmcraAuthor Commented:
Awesome, thanks!
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now