You probably need to take into account the fact that one or more of these items may be Null (empty) so
probably should be
= [nameofcontrolwithsubtotal1] + [nameofcontrolwithsubtotal2]
Having said that, I have to tell you that this is an unusual way of handling this type of situation. The standard way of doing an order/invoice situation would be using a one-to-many scenario, with the 'one' side being the Orders and the 'many' side being the Products. This is usually handled with a Main Form/Subform set up.
= Nz([nameofcontrolwithsubtotal1], 0) + Nz([nameofcontrolwithsubtotal2], 0)
In general terms the Main Form would be a Single View Form and based on a OrdersTable. The Subform would probably be a Datasheet View Form (to better display the 'Products' Field) based on a Products Table.
The Fields would typically be something like this:
OrdersID 'Primary Key
...and so forth
OrdersID 'Foreign Key
ProductsID 'Primary Key
...and so forth
Once you've designed your OrdersForm and ProductsForm, based on OrdersTable and ProductsTable, respectively, open the Main Form (OrdersForm) in Form Design View and add a Subform Control to it. The Subform Wizard will walk you through the process. When asked, base your Subform on the ProductsForm. Seeing that both Tables the Forms are based on have a Field named OrdersID, the Wizard should ask if you want to link the Main Form /Subform using these Fields. Answer OK and Bob's your uncle!
This would allow for an Order with one Product or one with a gazillion Products. You'd place a Calculated Control on your Subform to add up the Product * Price column then have a Control on the Main Form with this Control as its Control Source.
Last edited by Missinglinq; 01-10-12 at 21:54.
Hope this helps!
The problem with making anything foolproof...is that fools are so darn ingenious!
All posts/responses based on Access 2003/2007