Calculated field

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
How can I update a TOTAL field whose values is calculated by multiplication
of PRICE*UNITS in a table and in a grid form?
I'm new to Access.
Thanks
 
You don't store calculated values in a table in Access. You can do this in
your queries, reports, and forms. Your table should store the items that
make up the calculation (price and units), but not the calculated value.

In your query, you could add a new column and put something like this in
it...

TotalPrice: [Price] * [Units]

In an unbound filed in a report or form, you could put something like the
following:

=[Price] * [Units]
 
If you really have to store that value in a table, which isn't recommended as
previosly mentioned, you can run update query as soon as the value is
calculated using the value from the form.

This is a bit complicated since you have to know how to run a query
programatically.


--
Thanks,
Restu Kresnadi
www.restuphotography.com
Yes, I am a programmer and a photographer. Confused? Me too!


Rick B said:
You don't store calculated values in a table in Access. You can do this in
your queries, reports, and forms. Your table should store the items that
make up the calculation (price and units), but not the calculated value.

In your query, you could add a new column and put something like this in
it...

TotalPrice: [Price] * [Units]

In an unbound filed in a report or form, you could put something like the
following:

=[Price] * [Units]


--
Rick B



Josephine said:
Hi,
How can I update a TOTAL field whose values is calculated by
multiplication
of PRICE*UNITS in a table and in a grid form?
I'm new to Access.
Thanks
 
Back
Top