Sub form

  • Thread starter Thread starter cath
  • Start date Start date
C

cath

Hi

I wonder if you could help me.

I am trying to create a text box on a form to sum the amounts in the
subform but doesn't seem to be working.

Do you think you could advise.

Kind regards

Catherine
 
hi Catherine,
I am trying to create a text box on a form to sum the amounts in the
subform but doesn't seem to be working.
Do you think you could advise.
Place a TextBox in the footer section of your subform, assign
"=Sum([yourFieldName])" as ControlSource.

In the main form use "=[SubformControlName]![SumTextBoxName]" as
ControlSource for your TextBox.

mfG
--> stefan <--
 
First of all, if you are trying to sum calculated amounts, you will need to
put the calculation on your subform footer and use the whole calculation:

=Sum(Nz([MyField1],0) + Nz([MyField2],0))

The example above assumes you have two fields called MyField1 and MyField2
and you are adding them and then want the sum of them. Now, once you have
that, you can put a text box on the main form with this in the controlsource:

=[YourSubformContainerName]![Form]![YourSumTextBox]

Where it says YourSubformContainerName, make sure to put in the name of the
control on your main form that houses the subform, not necessarily the
subform name itself. If they are both the same, then that's fine but if they
are different you would use the container name and not the form name.
--
Bob Larson
Access World Forums Super Moderator
Utter Access VIP
Tutorials at http://www.btabdevelopment.com
__________________________________
If my post was helpful to you, please rate the post.
 
Back
Top