Transferring sum from subreport to main report

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Greetings,

My report includes a subreport named "LabSectionSubreport" with a control
named "PTWageSum" that totals a wage value with the following control source:
=Sum(Nz([PTWage],0))

I've added a control to the main report to capture the "PTWageSum" value
with this control source:
=[LabSectionSubreport].[Report]![PTWageSum]

It works fine as long as there is always a value in the subreport control.
Frequently, however, the subreport may be null, and the main report control
produces an #Error. Is there a way to convert that error to a value of 0?

Any assistance will be appreciated.

jn
 
=IIf([LabSectionSubreport].[Report].HasData,
[LabSectionSubreport].[Report]![PTWageSum],0)
 
Works like a charm. Thanks a million!

Duane Hookom said:
=IIf([LabSectionSubreport].[Report].HasData,
[LabSectionSubreport].[Report]![PTWageSum],0)

--
Duane Hookom
MS Access MVP


jnew said:
Greetings,

My report includes a subreport named "LabSectionSubreport" with a control
named "PTWageSum" that totals a wage value with the following control source:
=Sum(Nz([PTWage],0))

I've added a control to the main report to capture the "PTWageSum" value
with this control source:
=[LabSectionSubreport].[Report]![PTWageSum]

It works fine as long as there is always a value in the subreport control.
Frequently, however, the subreport may be null, and the main report control
produces an #Error. Is there a way to convert that error to a value of 0?

Any assistance will be appreciated.

jn
 
Back
Top