How to calculate "Items Total" on Order Form?

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.
 
T

tina

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
 
W

Will

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.
 
T

tina

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.
 

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

Top