Update Query

aussieolie

Australian
Local time
Today, 11:39
Joined
Apr 3, 2002
Messages
47
i wanted a calculated field in a subform. it needs to multiply a value in the subform by a value in the main form.
Basically the currency field is multiplyed by the quantity to work out the total. I run a macro which closes the form and runs an update query (calculates the total in the relevent table) and then re-opens the form. When I run the macro, it says: "Type Mismatch in Expression" I dont know why?? Any suggestions.
Thanks

Olie
 
You shouldn't store the results of a calculation, use a query or stay as you are with the calculated control.
 
The exception to this is if one of the values in your list may change at sometime (prices/invoices are notorious for this). in that case you can't calculate it reliably later and so it is appropriate to store it at the point of sale.

Don't use an update query though. Just make your calculated field bound to the storage field, and use the AfterUpdate event or a calculation button on your form to make Me.Field = Whatever*Calculation.

Note: this is ONLY for very certain circumstances that this is advised! Otherwise you will run into data corruption probelms faster than you can believe.
 

Users who are viewing this thread

Back
Top Bottom