Grand total of Subform Datasheet

aron.ridgway

Registered User.
Local time
Today, 16:46
Joined
Apr 1, 2014
Messages
148
After having no luck with the standard datasheet E-Totals, i'm now trying to have a textbox on the main form that totals a subforms column called lineTotal.

Line Total is a calculated query field that works out the Qty*cost.

So say if they put in 5 lines on the subform, the textbox field will sum all of there linetotal and shows a rolling grand total.

Any help would be great thank you!
 
in the subform footer section put an unbound control which sums the subform data. From you post I would expect it to be

=sum([LineTotal])

Lets call this control SFTotal

Then in your main form you would refer to this in another unbound control with it is controlsource as

mysubform.Form.SFTotal
 
Thank you for the reply, but will this work as my subform is a datasheet, which dose not allow form footers?

thanks
 
you can have form headers and footers - they just won't display in datasheet view
 
Oh i see, i have tried the following

Textbox In my subform footer
Code:
=Sum([Line Value])

Textbox in my main form
Code:
=[sfrmPurchaseOrder].[Form].[SFTotal]

Im getting #Name? in the textbox on the main form?
 
did you call your textbox in the subform footer SFTotal?
 
Yep just doubled checked and the text box on the subform is SFTotal??
 
in that case is your subform control called sfrmPurchaseOrder? or is that the name of the form - it needs to be the name of the subform control
 
sfrmPurchaseOrder is the name of my subform, isnt the subform control the textbox which we call SFTotal?
 
Ah just had a bingo moment, i have changed it to the query that the subfrom is based on. Found the error of my ways!

thanks
 

Users who are viewing this thread

Back
Top Bottom