access 2003 - calculating a grandtotal of a subform

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a subform which holds prices and i would like a grand total of these
prices in the "form" which contains the subform but all i seem to get is an
error. Not sure if i have made sense but fingers crossed! thanks
 
Hi Mariee,

Try something like this:

=dsum("nz([FIELDTOSUM], 0)", "TABLENAME_OF_SUBFORM_DATA", "[MAINFORMIDNAME]
= " & me.MAINFORMID)

Hope this helps.

Damian.
 
Thanks for trying but that didn’t work, let me try and explain my situation
better. My subform (fmOrdersDetails) consists of a field that calculates a
subtotal, it multiplies the [unitPrice] by the [quantity] and comes out with
a price for that item [subtotal], so I want it on the main form (fmOrders) to
calculate the total for that order which would be the total of all the
subtotals for that order.

Thank you sooo much in advance! - i'm close to kicking my computer to China!!


Damian S said:
Hi Mariee,

Try something like this:

=dsum("nz([FIELDTOSUM], 0)", "TABLENAME_OF_SUBFORM_DATA", "[MAINFORMIDNAME]
= " & me.MAINFORMID)

Hope this helps.

Damian.

mariee4 said:
I have a subform which holds prices and i would like a grand total of these
prices in the "form" which contains the subform but all i seem to get is an
error. Not sure if i have made sense but fingers crossed! thanks
 
Thanks for trying but that didn’t work, let me try and explain my situation
better. My subform (fmOrdersDetails) consists of a field that calculates a
subtotal, it multiplies the [unitPrice] by the [quantity] and comes out with
a price for that item [subtotal], so I want it on the main form (fmOrders) to
calculate the total for that order which would be the total of all the
subtotals for that order.

Thank you sooo much!


Damian S said:
Hi Mariee,

Try something like this:

=dsum("nz([FIELDTOSUM], 0)", "TABLENAME_OF_SUBFORM_DATA", "[MAINFORMIDNAME]
= " & me.MAINFORMID)

Hope this helps.

Damian.

mariee4 said:
I have a subform which holds prices and i would like a grand total of these
prices in the "form" which contains the subform but all i seem to get is an
error. Not sure if i have made sense but fingers crossed! thanks
 
Add a new text field to your subform; Give it a Name - "Total" no quotes;
then type in the control source row

=Sum([Name of Subtotal field])

Then, on your Form, add a text field and type in the control source row

=Forms![Name of Form]![Name of Subform]![Total]

mariee4 said:
Thanks for trying but that didn’t work, let me try and explain my situation
better. My subform (fmOrdersDetails) consists of a field that calculates a
subtotal, it multiplies the [unitPrice] by the [quantity] and comes out with
a price for that item [subtotal], so I want it on the main form (fmOrders) to
calculate the total for that order which would be the total of all the
subtotals for that order.

Thank you sooo much!


Damian S said:
Hi Mariee,

Try something like this:

=dsum("nz([FIELDTOSUM], 0)", "TABLENAME_OF_SUBFORM_DATA", "[MAINFORMIDNAME]
= " & me.MAINFORMID)

Hope this helps.

Damian.

mariee4 said:
I have a subform which holds prices and i would like a grand total of these
prices in the "form" which contains the subform but all i seem to get is an
error. Not sure if i have made sense but fingers crossed! thanks
 
Add a new text field to your subform; Give it a Name - "Total" no quotes;
then type in the control source row

=Sum([Name of Subtotal field])

Just an additional note: the Total textbox needs to be in the subform's Footer
or Header, not in the main part of the subform.

John W. Vinson [MVP]
 

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

Back
Top