View Full Version : Totals across subreports that may not have data


rhizopus
10-15-2002, 03:14 AM
I have one report that contains several subreports. In the reports footer I am attempting to make calculations from the results of several of the subreports. The subreports may not always yield data. This produces an "#Error" in the report footer calculations.

How can I handle these errors and perform these calculations when the subreports do no have any data. The calculations are simple additons. Example:

[Total Cash Sales] = ([Gear Subreport].Report![Gear Cash Sales]+[Food Subreport].Report![Food Cash Sales])

marrett
10-15-2002, 04:25 AM
All your fields ahave to have data to add them. Here is a way around it.

exp1: IIf([Food Cash Sales ] is null,0,[Food Cash Sales])

This will fill the empty fileds with zeros if there is not amount.

Maria

Rich
10-15-2002, 04:32 AM
You have to use the HasData method, there have been many examples posted here

rhizopus
10-15-2002, 05:18 PM
IIf(expresion Is Null, True, False) did not work. I believe in this example the data is not "null" bur rather "HasData" false. The following does not work either: IIF(expresion HasData, True, False). Any suggestions on syntax for using "HasData"

Rich
10-16-2002, 12:23 AM
It should read something like
=IIf([MoniesRecd].[Report].[HasData],[txtBal]-[MoniesRecd].[Report]![txtSubTot],[txtBal])
where txtBal is the original invoice amount and MoniesRecd displays any payments received for the invoice