Subform Totals on Main form by Criteria

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?
 
S

Steve Schapel

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"))
 
J

Jesse Aviles

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.
 

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