suppressing report print when subreports empty

jajones5

New member
Local time
Yesterday, 22:51
Joined
Apr 21, 2009
Messages
1
i have a main report in Access 2007 that is bound to a query and has four subreports in it's detail section.

by design, there is a high likelihood that most, if not all of the subreports will be empty. i would like to prevent the main report from printing if all of the subreports are empty. i would prefer not to put the text from the main report into the report header of the subreport because i don't want the person's name and the report period to be repeated 4 times if each of the subreports do contain data.

is there any way that this can be done?!

thanks!
 
This might help.

You could put four hidden controls on the main report and check if each of the sub reports 'has data' using the following snippet for each sub report

=IIf([mySubReportName].[Report].[HasData],1,0)

So, you have 4 control with 4 values, either 1 or 0, write an if statement that checks if all are set to 0 and if they are cancel your report.

Regards
Melt
 

Users who are viewing this thread

Back
Top Bottom