calculate when subrep has no records

G

Guest

My report calculates upon the total of the subreport, but some records on the
main report have no corresponding records on the subreport, so in the
calculated field on the main report, I get "#Error".

Main Report: Item Invoice
Sub_report: Payments Received

A customer can pay several times, so there is a sum of "payment amount" on
the subreport after the payment details. This field is called "sumofpayments"

On the main report, I have this: "=[grandtotal]-[Payments
Received].Report!sumofpayments" which calculates the balance due after all
payments, where "grandtotal" is the total of purchases on the main report.

When a customer has not made any payments, I would like to just to display
the balance due ("grandtotal") since the subreport doesn't display if there
are no records, but I'm not good with expressions.
 
G

Guest

Thank you, that was exactly what I needed.

Allen Browne said:
See:
Bring the total from a subreport onto a main report
at:
http://allenbrowne.com/casu-18.html

The article explains how to test the HasData property of the subreport.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

miss031 said:
My report calculates upon the total of the subreport, but some records on
the
main report have no corresponding records on the subreport, so in the
calculated field on the main report, I get "#Error".

Main Report: Item Invoice
Sub_report: Payments Received

A customer can pay several times, so there is a sum of "payment amount" on
the subreport after the payment details. This field is called
"sumofpayments"

On the main report, I have this: "=[grandtotal]-[Payments
Received].Report!sumofpayments" which calculates the balance due after all
payments, where "grandtotal" is the total of purchases on the main report.

When a customer has not made any payments, I would like to just to display
the balance due ("grandtotal") since the subreport doesn't display if
there
are no records, but I'm not good with expressions.
 

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