Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SumIf type function

Status
Not open for further replies.

puforee

Technical User
Oct 6, 2006
741
US
I have a form where I log Expenses and Income. I use the same value field for each... "Amount". The difference depends on if the "Expense" checkbox or "Income" checkbox is checked. Only one can be checked per record.

So, I want to show running totals for "Expense" and "Income" in my form header. In Excel I would do a SumIf statement and sum "Amount" if "Expense" is checked. And a Sum "Amount" if "Income" is checked. I would like to create two objects in the header of my form that would show the running total of Income and Expense.

How can I mechanize this?

Thanks,
 
two objects in the header of my form that would show the running total

Well, you could use the DSum() function with WHERE criteria, and programatically refresh the contents of a header text box or label after a form event fires.

Cogito eggo sum – I think, therefore I am a waffle.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top