Show subtotal from subform on main form

D

D. M.

Just when I thought I was finished, I found a new problem.

I have 2 forms: Orders and Order Details Subform (datasheet view). The
subform was created from the Order Details table. The fields are:
OrderDetailID (PK), OrderID(fk), Description, Unit Cost, Quantity.

On the subform I added a text field called Total Cost which calculates [Unit
Cost]*[Quantity]. I then added a text box called PO Total to the footer to
sum the Total Cost column "=Sum([Total Cost]".

I would like to show the PO Total on the Order form. I created a text box
with the control source set to: =Order_Details_Subform.Form!PO_Total.

This shows an error. What am I doing wrong? Can anyone help?
 
S

strive4peace

Make sure you use the NAME property of controls. Order_Details_Subform
may be your SourceObject, but it is not necessarily the Name too -- you
can make the Name whatever you want and I usually set it to be the same
as the SourceObject

Does the sum field show correctly on the subform?

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*
 
D

D. M.

Yes, the Name is correct. The sum field does not show because it's in the
footer of the subform, which is a datasheet. I can only assume that it's
correct. Again the control names are: Unit Cost, Quantity, Total Cost, the
calculated control in the footer is PO_Total (=Sum([Total_Cost]).

The control on the main Order form is: Main PO Total (=[Order Details
Subform].Form!PO_Total).

I have no idea what I'm doing wrong.

strive4peace said:
Make sure you use the NAME property of controls. Order_Details_Subform
may be your SourceObject, but it is not necessarily the Name too -- you
can make the Name whatever you want and I usually set it to be the same
as the SourceObject

Does the sum field show correctly on the subform?

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



D. M. said:
Just when I thought I was finished, I found a new problem.

I have 2 forms: Orders and Order Details Subform (datasheet view). The
subform was created from the Order Details table. The fields are:
OrderDetailID (PK), OrderID(fk), Description, Unit Cost, Quantity.

On the subform I added a text field called Total Cost which calculates [Unit
Cost]*[Quantity]. I then added a text box called PO Total to the footer to
sum the Total Cost column "=Sum([Total Cost]".

I would like to show the PO Total on the Order form. I created a text box
with the control source set to: =Order_Details_Subform.Form!PO_Total.

This shows an error. What am I doing wrong? Can anyone help?
 
S

strive4peace

Temporarily switch your subform to continuous forms and see if the
subtotal is right

what is your ControlSource for the subtotal? If it is adding a control
that is an equation, you must repeat the equation

ie:
=sum([qty] * [price])


Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



D. M. said:
Yes, the Name is correct. The sum field does not show because it's in the
footer of the subform, which is a datasheet. I can only assume that it's
correct. Again the control names are: Unit Cost, Quantity, Total Cost, the
calculated control in the footer is PO_Total (=Sum([Total_Cost]).

The control on the main Order form is: Main PO Total (=[Order Details
Subform].Form!PO_Total).

I have no idea what I'm doing wrong.

strive4peace said:
Make sure you use the NAME property of controls. Order_Details_Subform
may be your SourceObject, but it is not necessarily the Name too -- you
can make the Name whatever you want and I usually set it to be the same
as the SourceObject

Does the sum field show correctly on the subform?

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*



D. M. said:
Just when I thought I was finished, I found a new problem.

I have 2 forms: Orders and Order Details Subform (datasheet view). The
subform was created from the Order Details table. The fields are:
OrderDetailID (PK), OrderID(fk), Description, Unit Cost, Quantity.

On the subform I added a text field called Total Cost which calculates [Unit
Cost]*[Quantity]. I then added a text box called PO Total to the footer to
sum the Total Cost column "=Sum([Total Cost]".

I would like to show the PO Total on the Order form. I created a text box
with the control source set to: =Order_Details_Subform.Form!PO_Total.

This shows an error. What am I doing wrong? Can anyone help?
 

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

Form Problem 1
Total Detail on Continuous Form 5
Total in Footer 3
subform problems 2
Running Total from a Subform 3
Subform Subtotal 1
ignored filter on subform 3
#Name error 6

Top