Solved

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

Posted on 2013-05-14
2
1,206 Views
Last Modified: 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.
0
Comment
Question by:grmcra
2 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 39165903
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
 

Author Closing Comment

by:grmcra
ID: 39165951
Awesome, thanks!
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

730 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