View Full Version : Update Query


aussieolie
04-29-2002, 09:19 AM
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

Rich
04-29-2002, 11:03 AM
You shouldn't store the results of a calculation, use a query or stay as you are with the calculated control.

David R
04-29-2002, 11:40 AM
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.

aussieolie
04-30-2002, 03:36 AM
OK will try this.

Thanks for your help.

Olie