April15Hater
Accountant
- Local time
- Today, 09:38
- Joined
- Sep 12, 2008
- Messages
- 349
I'm just at a loss as to why this isn't working. In a nutshell, I'm trying to sum a control in the report footer. I have a textbox named txtTotal(which is what I'd like to sum) in the Detail section of my report with the following expression in the control source:
I know it's lengthy, but the good news here is that this part of the report works fine. My problem comes in when I try to sum this text box up. I have another text box in the Report Footer with the following expression:
When I run the report it is not recognizing the textbox and brings up a parameter box for txtTotal.
Any ideas?
Thanks,
Joe
Code:
=IIf([Function Name]='Approved Hours',
[txtUnit]*DLookUp("[HourlyRate]","tblContractor","[ContractorID] = " & [ContractorID]),
Round(IIf(IsNull([Aerial]),0,(([Aerial]/5280)*DLookUp("[FunctionCost]","tblContractorFunction","[FunctionID] = " & [FunctionID] & " AND [FunctionType] = 'Aerial'")))+IIf(IsNull([underground]),0,(([underground]/5280)*DLookUp("[FunctionCost]","tblContractorFunction","[FunctionID] = " & [FunctionID] & " AND [FunctionType] = 'underground'")))+IIf(IsNull([unit]),0,(([unit])*DLookUp("[FunctionCost]","tblContractorFunction","[FunctionID] = " & [FunctionID] & " AND [FunctionType] = 'unit'")))+IIf(IsNull([setup]),0,(([setup])*DLookUp("[FunctionCost]","tblContractorFunction","[FunctionID] = " & [FunctionID] & " AND [FunctionType] = 'setup'"))),2))
Code:
=Sum([txtTotal])
Any ideas?
Thanks,
Joe