Main Form / Subform Totals

B

Bob Love

I've asked this question before but have some how messed it up again. I have
a main form and subform. In the sub form footer I have a control named
Subtotal with the control source property = Sum([Extended Price). Extended
price is a calculated control on the subform. The subform is based upon a
table and not a query. I want to use the control in the footer of the
subform to fill in the "Subtotal" control on the main form. In the control
source property for the "Subtotal" control on the main form I have =[Order
Detail Subform]![Subtotal] but I get an error. This is in access 2007 BTW.
 
A

Al Campagna

Bob,
I always use the complete address on the Main to refer to a subform
control.
=Forms!MainFormName!SubformName.Form!Subtotal
You may have to do a Refresh when the subform ExtendedPrice changes, but
try it without it to start.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
B

Bob Love

Okay, I made it work and here's how. I don't know why its different but
here's what I changed. In the field in the footer of the subform named
Subtotal I changed the control source property from =Sum([Extended price]) to
=Sum([Quantity]*[Unit price]) and now it works. Can anyone explain the
difference?
 
A

Al Campagna

Bob,
Probably ExtendedPrice is an "unbound" calculated field, and can not be
Sum'd directly.
You can do the ExtendedPrice calculation in the query behind the form,
like this...
ExtendedPrice : Quantity * UnitPrice
Now... ExtendedPrice is a "bound" field, and can be added on the subform
by...
= Sum(ExtendedPrice)
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."

Bob Love said:
Okay, I made it work and here's how. I don't know why its different but
here's what I changed. In the field in the footer of the subform named
Subtotal I changed the control source property from =Sum([Extended price])
to
=Sum([Quantity]*[Unit price]) and now it works. Can anyone explain the
difference?
--
Bob Love


Bob Love said:
I've asked this question before but have some how messed it up again. I
have
a main form and subform. In the sub form footer I have a control named
Subtotal with the control source property = Sum([Extended Price).
Extended
price is a calculated control on the subform. The subform is based upon
a
table and not a query. I want to use the control in the footer of the
subform to fill in the "Subtotal" control on the main form. In the
control
source property for the "Subtotal" control on the main form I have
=[Order
Detail Subform]![Subtotal] but I get an error. This is in access 2007
BTW.
 

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

Similar Threads


Top