How to calculate "Items Total" on Order Form?

  • Thread starter Thread starter Will
  • Start date Start date
W

Will

OK, I have a calculation field in a query named "qryItemsToProducts"
.... like this... Total: [Unit Price]*[Qty]

And I have that "Total" displaying in a form named frmSubItems...

And I have the Orders Form... named frmOrders... with the above items form
as a ":sub form" ...

My Question: How do I display a field in frmOrders that shows the total of
all the items?

Kinda like this...

Order Total = Sum (Item_1*qty_1)+(Item_2*qty_2)+...+(Item-n*Qty_n)

I don't know the syntax for expressing this and any help would be
appriceated.

Thanks.
 
try adding an unbound textbox control to the subform's Footer section (you
can set its' Visible property to No, if you want to hide it); i'll call it
txtSubTotal. set the textbox's ControlSource property to

=Sum([Total])

in the main form, add another unbound textbox control, and set its'
ControlSource property to

=[NameOfSubformControl].[Form]![SubTotal]

make sure you use the name of the subform control (within the main form),
NOT the name of the subform as it shows in the database window. to make sure
you get the correct name, open the main form in design view, click once on
the subform (within the main form) to select it, and look at the Name
property in the Properties box.

hth
 
Thanks Tina. It worked !

tina said:
try adding an unbound textbox control to the subform's Footer section (you
can set its' Visible property to No, if you want to hide it); i'll call it
txtSubTotal. set the textbox's ControlSource property to

=Sum([Total])

in the main form, add another unbound textbox control, and set its'
ControlSource property to

=[NameOfSubformControl].[Form]![SubTotal]

make sure you use the name of the subform control (within the main form),
NOT the name of the subform as it shows in the database window. to make
sure
you get the correct name, open the main form in design view, click once on
the subform (within the main form) to select it, and look at the Name
property in the Properties box.

hth


Will said:
OK, I have a calculation field in a query named "qryItemsToProducts"
... like this... Total: [Unit Price]*[Qty]

And I have that "Total" displaying in a form named frmSubItems...

And I have the Orders Form... named frmOrders... with the above items
form
as a ":sub form" ...

My Question: How do I display a field in frmOrders that shows the total
of
all the items?

Kinda like this...

Order Total = Sum (Item_1*qty_1)+(Item_2*qty_2)+...+(Item-n*Qty_n)

I don't know the syntax for expressing this and any help would be
appriceated.

Thanks.
 
you're welcome :)


Will said:
Thanks Tina. It worked !

tina said:
try adding an unbound textbox control to the subform's Footer section (you
can set its' Visible property to No, if you want to hide it); i'll call it
txtSubTotal. set the textbox's ControlSource property to

=Sum([Total])

in the main form, add another unbound textbox control, and set its'
ControlSource property to

=[NameOfSubformControl].[Form]![SubTotal]

make sure you use the name of the subform control (within the main form),
NOT the name of the subform as it shows in the database window. to make
sure
you get the correct name, open the main form in design view, click once on
the subform (within the main form) to select it, and look at the Name
property in the Properties box.

hth


Will said:
OK, I have a calculation field in a query named "qryItemsToProducts"
... like this... Total: [Unit Price]*[Qty]

And I have that "Total" displaying in a form named frmSubItems...

And I have the Orders Form... named frmOrders... with the above items
form
as a ":sub form" ...

My Question: How do I display a field in frmOrders that shows the total
of
all the items?

Kinda like this...

Order Total = Sum (Item_1*qty_1)+(Item_2*qty_2)+...+(Item-n*Qty_n)

I don't know the syntax for expressing this and any help would be
appriceated.

Thanks.
 
Back
Top