Form with Sub Form Question

  • Thread starter Thread starter SteveH
  • Start date Start date
S

SteveH

I have an order form with a sub form showing order details. In the footer of
the order form, I have an unbound text box that I would like to show an order
total. The total would come from the line items in sub form. How can I
accomplish this? Also, would it be possible from the total text box to update
each time an order detail is added? Any help would be greatly appreciated.
 
Put a hidden text box (set its Visible property to No) in the footer
of your subform (name it, say, txtSubTotal). Set its Contol Source
to;

=Sum([SomeField])

Then put a text box in the footer of your main form and set its
Control Source to;

=[SubformControlName].[Form]![txtSubTotal]

Note: SubformControlName referes to the name of the sub form
control (the window) that holds the sub form, which may or
may not be the same as the name of the sub form itself.
 
That worked perfectly. Thanks!

Beetle said:
Put a hidden text box (set its Visible property to No) in the footer
of your subform (name it, say, txtSubTotal). Set its Contol Source
to;

=Sum([SomeField])

Then put a text box in the footer of your main form and set its
Control Source to;

=[SubformControlName].[Form]![txtSubTotal]

Note: SubformControlName referes to the name of the sub form
control (the window) that holds the sub form, which may or
may not be the same as the name of the sub form itself.

--
_________

Sean Bailey


SteveH said:
I have an order form with a sub form showing order details. In the footer of
the order form, I have an unbound text box that I would like to show an order
total. The total would come from the line items in sub form. How can I
accomplish this? Also, would it be possible from the total text box to update
each time an order detail is added? Any help would be greatly appreciated.
 
Back
Top