Using rules

N

Nick Heath

Hi i'm fairly new to InfoPath, i'm creating a Petty Cash form for my work,
and have a repeating table for expenditure items. At the bottom of the form
there is an expenditure summary which show the total expenditure for
different categories of items (each item in the repeating table is assigned a
category from a drop down menu). I'm having a little trouble making sure the
text boxes containing the totals stay up to date, i'm currently using rules
but it seems a bit messy doing it that way. Any ideas?

Cheers
 
S

S.Y.M. Wong-A-Ton

Rules is the way to go if you do not want to write code. What have you
already tried that makes you say it has become messy? I agree that if you are
using many rules, you will soon lose sight of what is updating what.
 
N

Nick Heath

Can't think of the best way to describe what i've tried, however I think the
problem with rules is that they only occur after an event, whereas programs
like excel calculate formulas as soon as any referenced cells change. Another
problem i've come across is that I can't seem to find a way of referencing
individual fields in a repeating table, or creating a recursive function that
allows me to trawl through each record. Might it be worth writing code? I'm
quite confident I can do it with code given a little time, I just thought it
might have been easier to use the functions of infopath.

ps any ideas of any good intermediate web tutorials for infopath as I find
these quite a good way to learn?

Thanks so much
 
S

S.Y.M. Wong-A-Ton

In InfoPath you must remember to put the rules on the fields that change,
since these will form the trigger to fill other fields.

You can write code to loop through the rows of a repeating table, but if you
are just performing sums, you can also use the sum() function on a field in a
repeating table. This will do the looping and summation over the repeating
table for you. The avg() function works in a similar way. I once wrote an
article that shows an example of how you could use the avg() function; see
http://enterprise-solutions.swits.n...le.php?t=avg-function-infopath&c=infopath2003

You can do much with rules without writing a single line of code, but it
will soon become complex.

There aren't many tutorials online. InfoPathDev has a few
(www.infopathdev.com) and I have a few on my own site
(http://enterprise-solutions.swits.net). You can find much information on
Office Online (http://office.microsoft.com/infopath), on the InfoPath Team
blog (http://blogs.msdn.com/infopath), and on MSDN.
 

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