Subform Totals on Main form by Criteria

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

Guest

On a subform I have fields ItemCost and PaymentType. I have a field in the
footer named TotalItemCost which is the Sum of ItemCost. I carry this total
to the main form for reference.

I need to put the totals for CashOnly, which is PaymentType="CA", on the
main form, too. Each entry in the subform requires a PaymentType. Since this
information is captured...what is the proper/best way to accomplish this?
 
JHK,

You could put an unbound textbox in the footer for TotalCash. The
control source could be like this...
=Sum(IIf([PaymentType]="CA",[ItemCost],0))
.... or, this would also work...
=-Sum([ItemCost]*([PaymentType]="CA"))
 
Assuming that every order is unique, you can write a query that sum only cash items from the open
order and then open it from code and push that value in your form.
 
Back
Top