Sum only selected controls

J

Jono

I'm working with InfoPath 2003.

I have a number of textboxes that give me totals from other sections. I
would like to add only the values in the textboxes that have their
corresponding checkboxes checked not the others. Once a checkbox is checked
the values that add up to the totals may change and therefore everything
needs to be able to update continuously.

I've tried having rules in the checkbox that sets the total to 0 if the
checkbox is unchecked and to give me the total value when it is checked, but
this leaves me with a static value.

Maybe this will help.

A1 = value
A2 = value
A3 = Total A1, A2
B1 = value
B2 = value
B3 = Total B1, B2
C1 = value
C2 = value
C3 = Total C1, C2

Checkbox 1 if checked add A3 into total D1
Checkbox 2 if checked add B3 into total D1
Checkbox 3 if checked add C3 into total D1

D1 = based on Checkboxes 1, 2 and 3
 
J

Jono

Thank you, I tried this and I still end up with a static value. Using the
example below I put a value into A1 at this point D1 = 0, then I checked the
A3 checkbox and the value was added into D1. Then I went back and changed the
value in A1, D1 did not update. How do I get it to update anytime a change is
made without having to uncheck and recheck the checkbox?
 
J

Jono

I don't know how to enter an "If/Then" statement into the formula. I t would
have to look something like this:
If CheckboxA (CBA) = 1 sum A3,D1, If CBB = 1 sum B3,D1, If CBC = 1 sum C3,D1.
I don't know how to write that into a formula, everything I've tried comes
up with errors. Also, would this formula update as the values were changed?
 

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