How to auto total on subforms

I

Iram

Hello.
I am running Access 2003 and I have a subform with two fields amongst many
called "Quantity" and "Price". I need to add another field called "Total" and
I need the DB to auto calculate the total for each record. Currently the
folks that deal with the database have to manually add up record to know
exactly how much each record totaled, Quantity * Price=...
Could you help me determine the best way to do this?

Your help is greatly appreciated.

Thanks.
Iram/mcp
 
A

Al Campagna

Iram,
The Total you refer to is commonly known as a LimeTotal field, often in a
continous subform containing multiple items.

Use an unbound text control in the subform ex. LineTotal with a Control
Source of...
= Price * Quantity
You do not save this field value to your table, you just display the
calculation on your subform. Since you capture the Price and the Quantity
to the table, you can always recalculate the LineTotal from those two
elements... on the fly...in any subsequent form , query, or report.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

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

Stockwell43

Hi Iram,

I have this in an unbound text box in the Control Source:

=Forms!frminvoices![frmbreakdown Subform2].Form!TotalAmount

The text box is on my main form. frminvoices is the name of the main form
and the other is the name of my suborm. Modify it to your form.

It works for me hopefully you can get it to work for you as well.
 

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