Referencing Subreport Field

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
 
M

Marshall Barton

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)
 
G

Guest

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top