The sum of 2 fields in an access table

  • Thread starter John-Ronkonkoma - Long Island, NY
  • Start date
J

John-Ronkonkoma - Long Island, NY

I am creating an access Table with several fields, I will then create a FORM
from the table. I have one number field "Number of stations", then a
currency field "Price per station" and then a currency field "Total Monthly"
I want to enter a number in the "number of stations" field and a dollar
amount in the "Price per station" currency field so it would be for example
10 x $7 and I want the total value $70 to automatically populate the "Total
Monthly" field. How do I do this?
 
F

fredg

I am creating an access Table with several fields, I will then create a FORM
from the table. I have one number field "Number of stations", then a
currency field "Price per station" and then a currency field "Total Monthly"
I want to enter a number in the "number of stations" field and a dollar
amount in the "Price per station" currency field so it would be for example
10 x $7 and I want the total value $70 to automatically populate the "Total
Monthly" field. How do I do this?


Access is not a spreadsheet.
You don't 'do this'.

All you need do is store the Number of Stations field and the Price
per Station field in your table.
Any time you need to know the total cost, calculate it.
In a query...
TotalMonthly:[NumberOfStations] * [PricePerStation]

Or, in a form or report, using an unbound text control:
= [NumberOfStations] * [PricePerStation]
 
J

John W. Vinson

I am creating an access Table with several fields, I will then create a FORM
from the table. I have one number field "Number of stations", then a
currency field "Price per station" and then a currency field "Total Monthly"
I want to enter a number in the "number of stations" field and a dollar
amount in the "Price per station" currency field so it would be for example
10 x $7 and I want the total value $70 to automatically populate the "Total
Monthly" field. How do I do this?

Storing derived data such as this in your table accomplishes
three things: it wastes disk space; it wastes time (almost
any calculation will be MUCH faster than a disk fetch); and
most importantly, it risks data corruption. If one of the
underlying fields is subsequently edited, you will have data
in your table WHICH IS WRONG, and no automatic way to detect
that fact.

Just redo the calculation whenever you need it, either as a
calculated field in a Query or in the control source of a Form or a Report
textbox.
 

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