IIf(Report.Hasdata, Sum(wte), 0)
This works OK when either report is run free standing.
The main report needs to calculate the difference between the two subreport sum controls, taking the smaller from the larger (it tests for if they're equal and produces an appropriate output).
This is working except for the no data case with one or both of the reports. In this situation, the calculated field displays #Error. By conditionally setting the subreport sum controls to zero, I thought that, in the main report, it would be still possible to access the subreport control in the nodata case; this seems not to be true.
Here's the calculation :
Code: Select all
=IIf([rptLeaversSub].[Report]![txtSumLeavers]=[rptStarters].[Report]![txtSumStarters],"Overall wte remains the same",IIf([rptLeaversSub].[Report]![txtSumLeavers]>[rptStarters].[Report]![txtSumStarters],"Net Loss to wte of " & ([rptLeaversSub].[Report]![txtSumLeavers]-[rptStarters].[Report]![txtSumStarters]),"Net gain in wte of " & ([rptStarters].[Report]![txtSumStarters]-[rptLeaversSub].[Report]![txtSumLeavers])))
Thanks
Silverback