Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Summing a complex formula

0 views
Skip to first unread message

JWCrosby

unread,
Jan 5, 2010, 2:22:01 PM1/5/10
to
I have a form set to continuous and one of the fields has this as the control
source:
=IIf([EI_Exempt]=Yes,Round(([EIBase]*DFirst("EI_Rate","tblTaxRates")))*Round(DFirst("EI_Employer_Rate","tblTaxRates")),0)

(Round is a defined function...rounds to the nearest cent.)

I've named that field EI_Employee

In the form footer I would like to show the sum of the column. If that's
possible, how would I do it?

I've tried using =SUM([EI_Employee]) and
=SUM(IIf([EI_Exempt]=Yes,Round(([EIBase]*DFirst("EI_Rate","tblTaxRates")))*Round(DFirst("EI_Employer_Rate","tblTaxRates")),0)) but neither has worked.

Any help would be appreciated.

John W. Vinson

unread,
Jan 5, 2010, 6:52:59 PM1/5/10
to

A Sum expression in a form footer can sum a *field in the form's recordsource*
- it will NOT sum a *control on the form*.

I'd suggest putting your first expression into the Query upon which the form
is based as a calculated field EI_Employee, and using that field as the
control source of the textbox on the form, and Sum([EI_Employee]) on the
footer.
--

John W. Vinson [MVP]

0 new messages