How do i get the total for a column on a sub form?

J

jct126

Hello everyone, i am really new to access, in fact i just downloaded a
template today! I've set about trying to adapt it to my needs and... even if
i do say so myself, i've done brilliantly. There is a sub form in one of the
forms and although it has taken me all night, i have managed to get the
columns from left to right to calculate as i want them to but now what i need
is the last column to add itself up and put a total in another box, outside
of the subform. Ive created the text box but i just can not work out what the
sum needs to be. Can anyone help? i'd be very very greatful thanks Jx
 
W

Wayne-I-M

=sum([fieldname])

Best to put this in the forms footer.

Use this as a reference for the "other field in the main form"

So if you create a sum in the footer of the subform in a box called XYZ.

Then your text box on the main box could be (source)

=Forms![MainFormName]![SubFormName].Form![XYZ]

good luck
 
J

jct126

Right... i have created a text box in the subform footer like this

=Sum([Price])

Price is the column i want it to add up

and on the main form i have created a text box with this in it

=[OrderDetailsSubform].Form!OrderDetailsTotal

I have tried it like this

=Forms![OrderDetailsSubform].Form![OrderDetailsTotal]

and loads of other combinations and sometimes i can get one of the lines to
display in the main form box but never the column total.

i guess im missing a main form name, but i just can't find one!!!

Any ideas????

Thanks for your help on this

Jx
Wayne-I-M said:
=sum([fieldname])

Best to put this in the forms footer.

Use this as a reference for the "other field in the main form"

So if you create a sum in the footer of the subform in a box called XYZ.

Then your text box on the main box could be (source)

=Forms![MainFormName]![SubFormName].Form![XYZ]

good luck


--
Wayne
Manchester, England.



jct126 said:
Hello everyone, i am really new to access, in fact i just downloaded a
template today! I've set about trying to adapt it to my needs and... even if
i do say so myself, i've done brilliantly. There is a sub form in one of the
forms and although it has taken me all night, i have managed to get the
columns from left to right to calculate as i want them to but now what i need
is the last column to add itself up and put a total in another box, outside
of the subform. Ive created the text box but i just can not work out what the
sum needs to be. Can anyone help? i'd be very very greatful thanks Jx
 
W

Wayne-I-M

=Forms!MainFormName!SubFormName.Form!SubFormBoxName


--
Wayne
Manchester, England.



jct126 said:
Right... i have created a text box in the subform footer like this

=Sum([Price])

Price is the column i want it to add up

and on the main form i have created a text box with this in it

=[OrderDetailsSubform].Form!OrderDetailsTotal

I have tried it like this

=Forms![OrderDetailsSubform].Form![OrderDetailsTotal]

and loads of other combinations and sometimes i can get one of the lines to
display in the main form box but never the column total.

i guess im missing a main form name, but i just can't find one!!!

Any ideas????

Thanks for your help on this

Jx
Wayne-I-M said:
=sum([fieldname])

Best to put this in the forms footer.

Use this as a reference for the "other field in the main form"

So if you create a sum in the footer of the subform in a box called XYZ.

Then your text box on the main box could be (source)

=Forms![MainFormName]![SubFormName].Form![XYZ]

good luck


--
Wayne
Manchester, England.



jct126 said:
Hello everyone, i am really new to access, in fact i just downloaded a
template today! I've set about trying to adapt it to my needs and... even if
i do say so myself, i've done brilliantly. There is a sub form in one of the
forms and although it has taken me all night, i have managed to get the
columns from left to right to calculate as i want them to but now what i need
is the last column to add itself up and put a total in another box, outside
of the subform. Ive created the text box but i just can not work out what the
sum needs to be. Can anyone help? i'd be very very greatful thanks Jx
 
Top