Article ID: 129721
Article Last Modified on 1/19/2007
=Sum([MySubReport].Report![Product Sales])on a main report to sum a reference to a subreport control that contains a subtotal, you receive a "#Name?" error message. This error message occurs because the Sum() function (and the other aggregate functions) can reference only fields, not controls. To avoid this error, place the sum expression in the subreport's report footer, and then reference that expression in the main report.
Name: Total
ControlSource: =Sum([ProductSales])
Format: Currency
NOTE: In version 2.0, there is a space in Product Sales.
Name: Category Total
ControlSource: =[Sales by Category Subreport].[Report]![Total]
Format: Currency
Name: Sales by Category Subreport Summary
SourceObject: Report.Sales by Category Subreport Summary
Name: Sales RunningSum
ControlSource: =Val([Category Total])
RunningSum: Over All
Visible: No
NOTE: You use the Val() function to convert the Variant returned by the
referenced control to a number so that the RunningSum property
accumulates the total.
Name: Grand Total
ControlSource: =[Sales RunningSum]
Additional query words: running
Keywords: kbhowto kbusage KB129721