Referencing Subreport Field

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

Guest

I have a field on my main report called InvoiceTotal and a field on a
subreport called DepositTotal. I have created a field on the main report
called InvoiceBalance where InvoiceBalance = InvoiceTotal - DepositTotal (on
the subreport). Question is: how do I reference the field in the subreport?
Thanks.
ck
 
CK said:
I have a field on my main report called InvoiceTotal and a field on a
subreport called DepositTotal. I have created a field on the main report
called InvoiceBalance where InvoiceBalance = InvoiceTotal - DepositTotal (on
the subreport). Question is: how do I reference the field in the subreport?

If there will always be a deposit total (i.e. the subreport
has at least one record), then you can use:

=InvoiceTotal - subreport.Report.DepositTotal

If the subreport may not have any details, then use this
instead:

=InvoiceTotal - IIf(subreport.Report.HasData,
subreport.Report.DepositTotal, 0)
 
Thanks, Marshall. That did the trick.
ck

Marshall Barton said:
If there will always be a deposit total (i.e. the subreport
has at least one record), then you can use:

=InvoiceTotal - subreport.Report.DepositTotal

If the subreport may not have any details, then use this
instead:

=InvoiceTotal - IIf(subreport.Report.HasData,
subreport.Report.DepositTotal, 0)
 
Back
Top