Calculated field

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
 
R

Rick B

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]
 
G

Guest

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
 

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