Update column in datasheet subform for each record!

L

Ladi

Hi all,

In a datasheet subform I need to update for each record the column "Value"
which is updated on afterupdate event by multiplying "Quantity" and
'Unitprice".
As a result I get whole column "Value" updated to a single value.

Anyone can help me?
 
G

Guest

You have a few problems here.
First, you should rename the Value field. Value is a reserved work in
Access and using any reserved word can confuse Access and cause problems.

Second, you should not be storing calculated values in a table. It violates
one of the basic rules of relational database design. Doing so wastes disk
space, takes longer, and is likely to become inaccurate because at some point
in time, someone may update one of the fields involved in the calculation and
cause it to be incorrect. If you have all the fields you need to perform the
calculation, you should do the calculation only to present the results to a
user or when that calculation is required as part of another calculation.

To present this calculated value, put something like the following in the
Control Source of what is now the Value field to show the calculation:

= [Quantity] * [Unit Price]
 

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