Calculating a total in a textbox.

  • Thread starter Thread starter Dustin I.
  • Start date Start date
D

Dustin I.

I have a textbox on a form called Total , on the form is
also a textbox called Shipping which contains the
shipping charges, what I need is for the total box to
display the total from a column in a subreport(datasheet)
+ the shipping charge, thus far I am unable to access the
properties of the subform, any suggestions?
 
1. Open your subform in design view.

2. In the Form Footer section, add a text box with these properties:
Name txtSubtotal
Format Currency
ControlSource =Sum([Amount])
where "Amount" is the name of the field to be summed.
Set the text box's or section's Visible property to No if desired.

3. On the main form, set the ControlSource of your text box to:

=Nz([NameOfYourSubformControlHere].[Form]![txtSubtotal],0) +
Nz([Shipping],0)

To get the name of your subform control:
- Open the main form in design view.
- Right-click the edge of the subform control, and choose Properties.
- The Name property is on the Other tab.
 
Thanks Allen Browne, much appreciated!
-----Original Message-----
1. Open your subform in design view.

2. In the Form Footer section, add a text box with these properties:
Name txtSubtotal
Format Currency
ControlSource =Sum([Amount])
where "Amount" is the name of the field to be summed.
Set the text box's or section's Visible property to No if desired.

3. On the main form, set the ControlSource of your text box to:

=Nz([NameOfYourSubformControlHere].[Form]! [txtSubtotal],0) +
Nz([Shipping],0)

To get the name of your subform control:
- Open the main form in design view.
- Right-click the edge of the subform control, and choose Properties.
- The Name property is on the Other tab.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

I have a textbox on a form called Total , on the form is
also a textbox called Shipping which contains the
shipping charges, what I need is for the total box to
display the total from a column in a subreport (datasheet)
+ the shipping charge, thus far I am unable to access the
properties of the subform, any suggestions?


.
 
Back
Top