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

IIF statement with subreport returning #NAME? 1

Status
Not open for further replies.

desperateUser

Technical User
Aug 4, 2005
47
CA
This is driving me nuts. I've tried everything I can think of. My controls do not have the same name as the data...Please help.

If the subform data is empty, I need to sum the report totals.

=(IIf([Reports]![rptCostTotal]![qryInvoiceTotal subreport]![SumofInvoiceAmt].[HasData],([Reports]![rptCostTotal]![qryInvoiceTotal subreport]![SumofInvoiceamt]+[Sumofparts_cost]+[Sumofcml_pts_cost]+[Sumoflabor_cost]),([Sumofparts_cost]+[Sumofcml_pts_cost]+[Sumoflabor_cost])))

I know I'm missing something!
Thanks!
desparateUser
 
Hi
I think this will get rid of the name problem:
[tt]=(IIf([Reports]![rptCostTotal]![qryInvoiceTotal subreport].Report.[HasData],([Reports]![rptCostTotal]![qryInvoiceTotal subreport]![SumofInvoiceamt]+[Sumofparts_cost]+[Sumofcml_pts_cost]+[Sumoflabor_cost]),([Sumofparts_cost]+[Sumofcml_pts_cost]+[Sumoflabor_cost])))[/tt]

But I think this might be what you need:
[tt]=nz([Reports]![rptCostTotal]![qryInvoiceTotal subreport].[Report].[SumofInvoiceamt],0)+[Sumofparts_cost]+[Sumofcml_pts_cost]+[Sumoflabor_cost][/tt]

You could try this, just to see:
[tt]=IIf([Reports]![rptCostTotal]![qryInvoiceTotal subreport].[Report].[HasData],"Yes","No")[/tt]
 
Yay! You helped me out tremendously! Thank you, enjoy the star :D
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top