Forms And Subforms

  • Thread starter Thread starter Kenj
  • Start date Start date
K

Kenj

I have a form that has company info + subtotal and tax and Total
In the form I have a sub form that has quanity,dis, unit price, Line total
in data sheet. I need to have a total of line total in subtotal on the Main
form
(sub form called miterals list1)(4)Colum
 
In the subform, add a footer and place a textbox named txtSumLineTotal in it
with the controlsource set to:

= Sum([Line Total Field])

Now set the subtotal textbox on the main form to:

= Forms![Your Main FormName]![Your Subform ControlName].Form.txtSumLineTotal

Of course use your own form and subform names.
 
Still geting #Name

Arvin Meyer said:
In the subform, add a footer and place a textbox named txtSumLineTotal in it
with the controlsource set to:

= Sum([Line Total Field])

Now set the subtotal textbox on the main form to:

= Forms![Your Main FormName]![Your Subform ControlName].Form.txtSumLineTotal

Of course use your own form and subform names.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


Kenj said:
I have a form that has company info + subtotal and tax and Total
In the form I have a sub form that has quanity,dis, unit price, Line total
in data sheet. I need to have a total of line total in subtotal on the
Main
form
(sub form called miterals list1)(4)Colum


.
 
Still geting #Name

Arvin Meyer said:
In the subform, add a footer and place a textbox named txtSumLineTotal in it
with the controlsource set to:

= Sum([Line Total Field])

Do you have a Field in the Query upon which your form is based, named

[Line Total Field]?

If not, replace Line Total Field with the actual fieldname from your query.

Note that this method will sum *fields in the form's recordsource*; it will
not sum *textboxes on the form*.
 
Back
Top