summing textBoxes

G

Guest

On a form I calculate the product of 2 numbers from a table and place them in
a corresponding textBox for that record on the form. The user can update
these 2 numbers or add a new record.I would like to sum the textBox's with
the products from each record in a textBox in the form footer but I
understand you can't do this.? How would I accomplish this task?
Thanks!
 
A

Al Campagna

For example... Price * Qty = LineTotal, and you want to add up all the
LineTotal amounts in the footer.
In the query behind your form, create a calculated "bound" field...
LineTotal : Price * Qty
Now place LineTotal on the form, and in the Form Footer an unbound
control with a ControlSource of...
=Sum(LineTotal)
will add up those values.
--
hth
Al Campagna
Access MVP 2007
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love, and you'll never work a day in your life."
 
G

Guest

I fairly new at this but I have 2 questions:
How do specify a calculated "bound" field
If I tie my form to a query as opposed to a table, will the user be able to
add new records
Thanks much for the help!
 
G

Guest

You are getting into dodgy territory with calculated fields. They should
never be stored in tables.

What do you mean by this: "The user can update these 2 numbers or add a new
record" ???
 
G

Guest

I don't store the calculated values. The 2 numbers I refer to are partCost
and partQuantity. I calculate the total part cost but mult these 2 fileds,
but I don't have them in a table.
Thanks
 
A

Al Campagna

Use the Query Design screen, bring in all the table fields you need...
and...
In a blank column, in the query rows....
Field: LineTotal : Price * Qty
Table: (there is no table)

This creates a calculated field "bound" (during the report) to the name
LineTotal.
Create a new text control with a ControlSource of LineTotal.
This LineTotal value/s will NOT be saved to the table, but will diplay
(when the report runs) the correct calculated value for LineTotal.
And... will allow adding up, in any Group or Report footer with
=Sum(LineTotal)
--
hth
Al Campagna
Access MVP 2007
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love, and you'll never work a day in your life."
 

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