using nz on a report

  • Thread starter Thread starter mgm
  • Start date Start date
M

mgm

I want to sum the "Charge" field of a subreport that has it's datasource as
a table. I've added a text box to the detail section of the main report and
I want this text box to show the sum. I'm a rooky with access reports and
I'm stumped on the syntax to do this... sometimes forms are a lot easier!
example of what I've tried....
=nz(Sum([Plans_prod subreport].Report!Charge))
 
Mgm,

I'm pretty sure you have to do the totalling on the subreport first, via
a textbox (possibly Visible=No) in the footer, with controlsource
=Sum([Charge]). Give this a name, let's say you call it TotalCharge,
and then you can refer to it from a control on the main report...
=[Plans_prod subreport]![TotalCharge]
 
I agree with Steve. If there is a possibility of no matching records in the
subreport, you should use:

=IIf(srptCtrlName.Report.HasData, srptCtrlName.Report.[TotalCharge], 0)

--
Duane Hookom
MS Access MVP


Steve Schapel said:
Mgm,

I'm pretty sure you have to do the totalling on the subreport first, via
a textbox (possibly Visible=No) in the footer, with controlsource
=Sum([Charge]). Give this a name, let's say you call it TotalCharge,
and then you can refer to it from a control on the main report...
=[Plans_prod subreport]![TotalCharge]

--
Steve Schapel, Microsoft Access MVP

I want to sum the "Charge" field of a subreport that has it's datasource as
a table. I've added a text box to the detail section of the main report and
I want this text box to show the sum. I'm a rooky with access reports and
I'm stumped on the syntax to do this... sometimes forms are a lot easier!
example of what I've tried....
=nz(Sum([Plans_prod subreport].Report!Charge))
 
Back
Top