# Summing a complex formula

J

#### JWCrosby

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.

J

#### John W. Vinson

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.

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.

## 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.