Forms And Subforms

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
 
A

Arvin Meyer [MVP]

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

Kenj

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


.
 
J

John W. Vinson

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

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