Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get a subtotal of records in a subform on the main form 2

Status
Not open for further replies.

vandergeek

Technical User
Joined
Dec 7, 2001
Messages
6
Location
GB
Hi,

I dont know if this has been discussed in the archives, but Im desperate and need some help/info asap. I have a form with order info, and a subform on it with items for that order. On the main form, I need a text box that sub totals the prices of the items in the subform. I have tried using the dsum but I cant get it working. Is there any vba I need to do this, or can it be done with dsum and I just dont get it?

I would be really really grateful of any response,

Thanks,
VDG.
 
Put a control that sum's the field in the subform's page header. Then set a control equal to that control in the subform...
=Me![SubFormControl].Form![ContolNameOnSubForm]
 
Easiest way-
In Form Footer of subform, add unbound text box (Subtotal) and in Control Source add =Sum(FieldName). You can deselect the visible criteria so it is unseen. On the main form, add an unbound text box which displays the same info as in the Sum box in the Subform. In the Control Source add =[Subform].[Form]![Subtotal]. Sean.
 
Thanks for the help, much appreciated.

VDG.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top