Copy data from form to table

  • Thread starter Thread starter L. Woodhouse
  • Start date Start date
L

L. Woodhouse

I have a calculated value in my form but it is not copying
the data to the related table like the values that I just
type in do. How do I do this?
 
Usually you don't want it to do that as a calculation can
always be calculated when needed and good rules of
normalization say that you don't store a calculated value.
What you can do is to create a calculated field as a new
field in a query and then base your form and reports on this
query. Now when you base a control on this new field it is
always there and 'appears' that it is part of the record.
Here is the syntax for creating the query field...

Total:[Qty]*[Price]

--

Gary Miller
Gary Miller Computer Services
Sisters, OR
________________________
 
The calculated result is not stored because a calculated control can not be
bound to a table field, since the control source is the calculation formula.

To start with, if you are storing all the numbers that make up the
calculation formula, why store the calculated result?
You can calculate the value wherever you need it.

However, if there is a good reason for storing the result you could add a
hidden field bound to the table field, then use some event procedure to copy
the contents of the calculated control to the hidden one. One possibility
would be the lost focus event procedure for the last control that is
included in the expression.

Ragnar
 
Back
Top