Help! i cant get Nz function to work in report!

M

mark909

I have a reports that has several subreports.

Each of the subreports records the costs of assets and give the total cost
of each of the asset types used in a project.

The cost in a subreport are totalled using the show grand total in the
groups options.

I've written a query to created a total of all the total costs from each
subreport

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

This works fine when all the reports are present. However sometimes a a
subreport may not contain any data so comes up blank. The text box shows an
ERROR# message.

Ive been trying to use the Nz function to force null values as a 0

=Nz([rptTotProjCostDuct
subreport].[Report]![txtTotProjCostDuct],0)+Nz([rptTotProjCostChambersCost
subreport].[Report]![txtTotProjCostChambersCost],0)+Nz([rptTotProjCostCableCost subreport].[Report]![txtTotProjCostCableCost],0)+etc

However I still get the ERROR# message.

Am i doing this wrong or is there something else i need to do?
 

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