Calculated field on Access Form

I need to calculate a value in a field in the footer section of a form (e.g. Sum), but need to multiple that value by a number that is in another footer field.  Access keeps giving me an error when I reference the other footer field.  (I'm actually trying to multiply the sum of one of the detailed columns by a percentage that is stored in another footer field).

Thanks...Tom
tpigielskiAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
Show the calculation that is giving the error ...

mx
p912sCommented:
What is the specific error?

Here's a good primer on how to reference conmtrols between forms/subform.
http://www.mvps.org/access/forms/frm0031.htm

Scot
tpigielskiAuthor Commented:
This is the calc giving the error:

=Sum(([Quantity On Hand]*[UnitPrice])*(1-[txtDiscount]))

Quantity On Hand and UnitPrice are in the Detail section of the form.  txtDiscount is in the footer section of the form.
Thanks..Tom
Your Guide to Achieving IT Business Success

The IT Service Excellence Tool Kit has best practices to keep your clients happy and business booming. Inside, you’ll find everything you need to increase client satisfaction and retention, become more competitive, and increase your overall success.

p912sCommented:
What is the error?

Error number?
tpigielskiAuthor Commented:
no error number...just #ERROR in the field when I get out of design view.
p912sCommented:
In that case it's not understanding something in your formula..

Can you post a screenshot of the form with the error displayed?
Dale FyeOwner, Dev-Soln LLCCommented:
My guess is that [txtDiscount] is the "other field in the Footer of the form, but is this a bound field, or unbound?

Have you tried:

=Sum([Quantity On Hand]*[UnitPrice])*(1-[txtDiscount])

or

=Sum([Quantity On Hand]*[UnitPrice])*(1-me.txtDiscount)

or

=Sum([Quantity On Hand]*[UnitPrice])*(1-val(me.txtDiscount))




Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
As fyed is implying, you cannot user Sum (or other aggregate functions) on Controls, only on bound fields in your form/report.

mx
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.