Subforms and simple addition

J

J Spector

Hello-

I seem to be at a roadblock in acess. I have a form like a mailing list,
but had a subform to add anywhere from 0 - 12 payroll deductions with
variable amounts. I have created the subform but cannot figure out how to
total the amounts inputted in the deductions column. How can I achive this?
 
A

Arvin Meyer [MVP]

Put a footer in the subform. Put a textbox in the footer and set its
controlsource to:

=Sum([Deductions Column])

Name it something like txtSubfrmTotal and set its height to zero(0) and the
height of the footer to zero, so the text box and the footer cannot be seen.
Add another textbox, this time on the main form, and set its controlsource
to:

=[Forms]![FormName]![NameOfSubformControl].Form![txtSubfrmTotal]

That should do it.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access

J Spector said:
Hello-

I seem to be at a roadblock in acess. I have a form like a mailing list,
but had a subform to add anywhere from 0 - 12 payroll deductions with
variable amounts. I have created the subform but cannot figure out how to
total the amounts inputted in the deductions column. How can I achive
this?
 
J

J Spector

I have tried this method, of course swapping out the variables for my own
field names, but yet all I see outputted is: #Name?


Arvin Meyer said:
Put a footer in the subform. Put a textbox in the footer and set its
controlsource to:

=Sum([Deductions Column])

Name it something like txtSubfrmTotal and set its height to zero(0) and the
height of the footer to zero, so the text box and the footer cannot be seen.
Add another textbox, this time on the main form, and set its controlsource
to:

=[Forms]![FormName]![NameOfSubformControl].Form![txtSubfrmTotal]

That should do it.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access

J Spector said:
Hello-

I seem to be at a roadblock in acess. I have a form like a mailing list,
but had a subform to add anywhere from 0 - 12 payroll deductions with
variable amounts. I have created the subform but cannot figure out how to
total the amounts inputted in the deductions column. How can I achive
this?
 
A

Arvin Meyer

Make sure that you are using the name of the subform control, NOT the name
of the subform. They can be different.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access Downloads
http://www.datastrat.com
http://www.mvps.org/access

J Spector said:
I have tried this method, of course swapping out the variables for my own
field names, but yet all I see outputted is: #Name?


Arvin Meyer said:
Put a footer in the subform. Put a textbox in the footer and set its
controlsource to:

=Sum([Deductions Column])

Name it something like txtSubfrmTotal and set its height to zero(0) and the
height of the footer to zero, so the text box and the footer cannot be seen.
Add another textbox, this time on the main form, and set its controlsource
to:

=[Forms]![FormName]![NameOfSubformControl].Form![txtSubfrmTotal]

That should do it.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access

J Spector said:
Hello-

I seem to be at a roadblock in acess. I have a form like a mailing list,
but had a subform to add anywhere from 0 - 12 payroll deductions with
variable amounts. I have created the subform but cannot figure out how to
total the amounts inputted in the deductions column. How can I achive
this?
 
Top