- Joined
- Sep 13, 2011
- Messages
- 3
- Reaction score
- 0
Hi,
I have a rptServiceBalanceSheet, and it has a number of Sub-reports.
In many instances some of the Sub-reports will have no data and as a result the total for the Sub-report in the Sub-report footer will give me a #Error.
This Sub-reports, rptsubMiscCodes, has the following controls:
ContractId CodeName Total .... there is another total below this one which is used for the running sum over the group and it is hidden.
The control source is ContractId and then CodeName and finally for both of the Totals we have an argument:
=IIf(DCount("[CodeName]","qryMiscCodes","[CodeName] = '" & [ctlCodeName] & "' And [ContractID] = '" & [ctlContractID] & "' And [EmployeeName] = '" & [ctlEmployeeName] & "' ")>1,DSum("Nz([DirectTime])+Nz([IndirectTime])","qryMiscCodes","[CodeName] = '" & [ctlCodeName] & "' And [ContractID] = '" & [ctlContractID] & "' And [EmployeeName] = '" & [ctlEmployeeName] & "' "),DSum("Nz([Total])","qryMiscCodes","[CodeName] = '" & [ctlCodeName] & "' And [ContractID] = '" & [ctlContractID] & "' And [EmployeeName] = '" & [ctlEmployeeName] & "' "))
In the format attribute of the property sheet for the Total control including the one for the running sum, I have 0.00;0.00;0.00;0.00. I also use the same format in the queries for these Sub-reports.
The Sub-report works well and gives accurate and approriate totals if the Sub-report has data. Even in the detail section the Totals show a zero if there is no data, but as noted earlier the total in the Sub-report footer, which references the name of the running total in the detail section,ie. =Nz([MiscServicesRunningSum]), gives me a #Error.
Any ideas as to how get something other than a #Error in the Total for the Sub-report footer?
Thanks for any help, suggestions or pointers.
Tom.
I have a rptServiceBalanceSheet, and it has a number of Sub-reports.
In many instances some of the Sub-reports will have no data and as a result the total for the Sub-report in the Sub-report footer will give me a #Error.
This Sub-reports, rptsubMiscCodes, has the following controls:
ContractId CodeName Total .... there is another total below this one which is used for the running sum over the group and it is hidden.
The control source is ContractId and then CodeName and finally for both of the Totals we have an argument:
=IIf(DCount("[CodeName]","qryMiscCodes","[CodeName] = '" & [ctlCodeName] & "' And [ContractID] = '" & [ctlContractID] & "' And [EmployeeName] = '" & [ctlEmployeeName] & "' ")>1,DSum("Nz([DirectTime])+Nz([IndirectTime])","qryMiscCodes","[CodeName] = '" & [ctlCodeName] & "' And [ContractID] = '" & [ctlContractID] & "' And [EmployeeName] = '" & [ctlEmployeeName] & "' "),DSum("Nz([Total])","qryMiscCodes","[CodeName] = '" & [ctlCodeName] & "' And [ContractID] = '" & [ctlContractID] & "' And [EmployeeName] = '" & [ctlEmployeeName] & "' "))
In the format attribute of the property sheet for the Total control including the one for the running sum, I have 0.00;0.00;0.00;0.00. I also use the same format in the queries for these Sub-reports.
The Sub-report works well and gives accurate and approriate totals if the Sub-report has data. Even in the detail section the Totals show a zero if there is no data, but as noted earlier the total in the Sub-report footer, which references the name of the running total in the detail section,ie. =Nz([MiscServicesRunningSum]), gives me a #Error.
Any ideas as to how get something other than a #Error in the Total for the Sub-report footer?
Thanks for any help, suggestions or pointers.
Tom.