Sum a row of values

L

LBlake

I'm just starting with infopath (2007) and am doing a simple timesheet form.
I have a table with 7 columms for days of the week. Each day has a drop-down
list box to select the hours for that day. The eighth column has an
expression box to sum up the fields in the row. I've entered this formula as
the expression:
sum(my:reg_day01/../my:reg_day02/../my:reg_day03/../my:reg_day04/../my:reg_day05/../my:reg_day06/../my:reg_day07).
When I do "Verify Formula" it indicates it doesn't contain errors. But when I
close and reopen the "Insert Function" dialog it shows sum(reg_day07) as the
formula, and only the value in that field is being expressed. I would be
thankful for any help regarding what I am missing doing a simple sum on
multiple fields.
 
S

S.Y.M. Wong-A-Ton

Try adding a rule on each one of the day fields. This rule must set the value
of the 8th column to the sum of the day fields. Use something like:

.../my:reg_day01 + ../my:reg_day02 + ../my:reg_day03 + ../my:reg_day04 +
.../my:reg_day05 + ../my:reg_day06 + ../my:reg_day07

as the value to set the 8th column to instead of using sum().
 
G

g

S.Y.M. Wong-A-Ton said:
Try adding a rule on each one of the day fields. This rule must set the value
of the 8th column to the sum of the day fields. Use something like:

../my:reg_day01 + ../my:reg_day02 + ../my:reg_day03 + ../my:reg_day04 +
../my:reg_day05 + ../my:reg_day06 + ../my:reg_day07

as the value to set the 8th column to instead of using sum().
 
G

Greg Collins

Adding a rule to each of the 7 boxes to set a sum to the 8th is cumbersome.
Why not instead use a default value formula on the 8th box which sums the
values of the first seven using the calculation that S.Y.M. Won-A-Ton
suggests?
 

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