Total Costs in Text Box. I get error if values are missing... --

M

mark909

Hi, I have the following query set up in a text box to sum the total cost of
a number of subreports within a report:

=[rptTotProjCostDuct
subreport].[Report]![txtTotProjCostDuct]+[rptTotProjCostChambersCost
subreport].[Report]![txtTotProjCostChambersCost]+[rptTotProjCostCableCost
subreport].[Report]![txtTotProjCoatCableCost]+etc.....

The report runs off a parameter query for different projects.

However some projects might not have any information for:

=[rptTotProjCostDuct subreport].[Report]![txtTotProjCostDuct] for example

When this happens the the query results in:

#Error

How can I write the query so it will give me a total if some of the
Subreports are blank??
 
K

KARL DEWEY

Use the Nz function --
=Nz([rptTotProjCostDuct subreport].[Report]![txtTotProjCostDuct], 0)
+Nz([rptTotProjCostChambersCost
subreport].[Report]![txtTotProjCostChambersCost],0) +
Nz([rptTotProjCostCableCost subreport].[Report]![txtTotProjCoatCableCost], 0)
+ Nz(etc.....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top