Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculate sum for field in subreport

Status
Not open for further replies.

Newposter

Technical User
May 9, 2002
735
US
I have a Report which includes two Subreports, linked by a one-to-many relationship of the Part Number field. In one Subreport, I have a field showing Annual Usage of an assembly. What I'd like to do is have a field summing all of the Annual Usages for the records in that Subreport that correspond to a Part Number. So for a part number used in 4 different assemblies, all with some annual usage, I'd like to display the sum of the 4 usages on my report.

When I try to use a text box with code =Sum([AnnualUsage]) it prompts me for a value when I open the report. If I leave it blank, nothing is shown for the sum. How do I code this box to reference the sum of each grouping of part numbers? Newposter
"Good judgment comes from experience. Experience comes from bad judgment."
 
I would like to know the same. In addition, I would like to know how to identify if a subreport is 'null' for a particular record. 'Is null' and Isnull() and NZ() do NOT work for fields on a subreport. Any ideas?

Jon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top