Can't get blank record sub-reports to show in Access 2010
Posted on 2013-05-14
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.