Updating table with value in form

PulseTeqUser

Registered User.
Local time
Today, 03:00
Joined
May 2, 2017
Messages
15
Hi

I have a table called Orders and a form called OrdersPlaced. There is a field on the form called TotalValue which is the sum of the values of the lines on the order. How call I get this value to update the field called TotalValue in the Orders table?

Thank you
 
There should NOT be a field in the table for total. This should be a calculated field,
Either in a query, or a calc field on a form.
 
Thank you for replying. However, the form contains a sub form where we enter the various items on the order. I store each of these against the order and total the values so we can see the total for each order. If I don't hold these totals in the table how can I query how much we have spent with each supplier?
 
Add them up in another query.
The reason for this is that if any of the order line values change anywhere on any form, you have to remember to recalculate and restore the new value. This isn't generally good practice and makes for more unmanageable results as things grow.
 
As Minty has said, storing calculated Fields, which is what you're talking about, here, is seldom a good idea. For a number of reasons, it's simply better to recalculate the value, as needed, whether in another Query, Form or Report.

The exception to this rule would be in dealing with something that involves, for example, a sales tax, which could change (sadly, only going up) over time. Then you have the choice of saving the total to a Table, a no no, or saving the tax rate, already stored in one Table, in the orders Table, another no no.

But in this situation, storing the total is a definite misstep.

Linq ;0)>
 

Users who are viewing this thread

Back
Top Bottom