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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to control a running sum with no records returned

Status
Not open for further replies.

Kumba1

Technical User
Aug 29, 2002
94
I have a Master Inventory report, sub-divided into 9 different departments, with itemized inventory... some departments currently have nothing in their inventory... in the footer of the subform itself, I created a text-box named "ExtSum" and I was able to use this statement to show 0 if there were no records:

iif(isnull([rptInventoryParts]![sum]),0,[rptInventoryParts]![sum)

this yielded either a sum for their inventory, or 0 if there were no records in the report... Now, at the footer of the Master Inventory Report itself, I wanna have these sub-totals summed up into different groups (For instance, one total representing the departments handling raw materials, another representing departments handling work in progress, and the last for departments handling finished goods). However, all I get is an error when I try to link to the "extsum" boxes for the different department subforms... any ideas? I know it has SOMETHING to do with the face that a subform has no records returned...
 
Are you sure you are using "subforms" and not "subreports"?
If you don't return records in a subreport, you can use an expression like:
=IIf(srptName.Report.HasData, srptName.Report.txtBox, 0)

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
Yes, sorry for the wrong terminology... it's all a report/subreport... thanks...
 
Did the syntax help? Have you solved your problem?

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
Yes, it did exactly what I needed to do... no more #Error for a total :) Many thanks...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top