I'm building a database to process orders. I'm getting there (slowly) and have got a form, with a sub-form, set up that allows me to create a new order record for a client and add a number of products to it. The form is based on a query that i've set up.
Within the query, i've got some calculations to work out the cost of x quantity of a product, the VAT, a discount (if selected) and the total. All good so far.
The thing is, it's supposed to allow as many products to be added to one order as required, in any quantity. So, if i've order 5 of one thing, 4 of another i want it to not only tell me the total for each line but the total cost overall.
I've attached two screen prints: one showing the order screen as it is so far so you can see what i'm on about and another showing the calculation bit of the query i mentioned.
My question is: how can i place a label/text box on the main part of the form and have the totals of each product line be added-up and populate the label on the form?
Bah, I've had to type this twice now. Damned computers that lock up / freeze are the pits.
Anyway, I can only give you general steps:
Create a textbox in your subform's footer called txtTotal.
Set the control source for txtTotal to =Sum([FieldToAddUp]).
Set the form footer's Visible property to No.
Create a textbox in your mainform called txtSubformTotal.
Set it's control source to refer to the txtTotal field on the subform. The syntax for that might be something like [subformObjectName]![txtTotal], but I am not so sure on that; I'd have to check it out with the build button.