Problem with IIf/HasData and subreport sum

Slow1911s

New member
Local time
Today, 18:43
Joined
Feb 8, 2007
Messages
6
I'm using this format to display subreport data in a group footer on my main report:

=IIf([subReportName].[Report].[HasData],[subReportName].[Report]![subReportTextboxNameName],0)

However, if the subreport has data (true), I need the sum of the subreport field. I tried adding sum before the TRUE statement, but that give me #ERROR.

Thanks in advance!
 
The Sum is done in the subreport footer and that textbox is referenced in the code supplied
 
Ok, I've done that now. But, when my subreport has values in multiple rows, the result is only the value in the bottom/last row, not a sum of all of the values.

In the subreport report footer I have =sum([CountOfxxx]) and I named the control XXTotal in the properties

Then in the main report group footer I have: =IIf([subReportName].[Report].[HasData],[subReportName].[Report]![xxTotal],0)

Does the grouping on the main report have anything to do with this?
 
Sounds as though your Sum is in the subreport page footer and not the subReport Footer
 
I don't know if this has anything to do with it or not, but the subreport's child and master fields are both linked to the same text box in the main report.
 

Users who are viewing this thread

Back
Top Bottom