Forms/Subforms Calculation issues

C

cathywoodford

Hello. I have an orders form that contains customer id, order id and
order date and it's control source is the order table. This also
contains a text box for order subtotal, sales tax and order total.

I have an orderdetailsubform based on the orderdetails table that
contains product, quantity, unit price, discount, extended price and a
unbound text box. I want extended price to be calculated
automatically by setting it's control source to = quantity * unit
price and then I set the unbound text box to = sum(extended price) -
which should be my subtotal. In the ordersubtotal text box I have the
control souce set to =[Order Details Subform].Form!OrderDetailsTotal
but it's not working. It doesn't total the order. It will work if I
didn't calculate the extended price but I don't want to have the users
to have to calculate their own total for quantity * price.

Hope someone can help.
 
W

Wolfgang Kais

Hello "(e-mail address removed)".

Hello. I have an orders form that contains customer id, order id and
order date and it's control source is the order table. This also
contains a text box for order subtotal, sales tax and order total.

I have an orderdetailsubform based on the orderdetails table that
contains product, quantity, unit price, discount, extended price and
a unbound text box. I want extended price to be calculated
automatically by setting it's control source to = quantity * unit
price and then I set the unbound text box to = sum(extended price) -
which should be my subtotal. In the ordersubtotal text box I have the
control souce set to =[Order Details Subform].Form!OrderDetailsTotal
but it's not working. It doesn't total the order. It will work if I
didn't calculate the extended price but I don't want to have the users
to have to calculate their own total for quantity * price.

Hope someone can help.

First:
The OrderDetailsTotal textbox should be in the footer or header section
of the subform.
Second:
When using a sum (or other aggregate-) function, you must not use a
calculated control as the argument. The argument must be from the
recordsource of the form. Therefore, the controlsource should be:
=Sum([quantity] * [unit price])

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top