calculations on forms

  • Thread starter Thread starter m0nkey_mafia
  • Start date Start date
M

m0nkey_mafia

Guest
i have an order form, and wish to display the subtotal of orders placed
i dont know how to do this on the form though
on the form i have WineID which is the id of the wine product ordered
and BottleQuantity, which is the quantity of products ordered
i can write the query myself, i just need to know how to do it on the form? any help much appreciated thanks
 
Write the query including the price of the wine. You may need to create a calculated field in the query by multiplying the number ordered by the value of the bottle in the query (eg WineCost = WinePrice * BottlesOrdered). To total this, in the footer of the form, have an unbound control with the controlsource =Sum([WineCost]
 
i decided on an alternate solution of storing the (sub)totals in the database rather than calculating it on the fly, however, im unsure how make the SubTotal field in the Order table calculate the currently chosen wine * price of wine
any ideas? (pseudo code is fine)
thanks
 
Generally speaking it is not best practice to store something that you can calculate. There are exceptions of course. Your method will give you a record of the current subtotal but if you had a more robust structure, ie include an audit trail of wine prices, then you could calculate the values from anytime with any wine (I'm a poet and I didn't know it)
 
You may want to avoid asking the same question twice. It takes time away from helping other people with their questions when two people have to answer your question. Also, when you post in one thread, make sure the question is relavent to the topic.

Just a little future FYI and welcome to Access World Forums.

Vassago
 

Users who are viewing this thread

Back
Top Bottom