Hi everyone,
I am using the form template feature in InfoPath 2007 and inserting several instances of the same template part into a form. When I do this, it automatically appends and _1, _2 etc. after the field names so they are unique in the form. For example, I have a True/False element in the template part called "complete", and when I insert it several times into a template I get complete_1, complete_2, complete_3, etc.
What I would like to do is create a field in my template that counts the number of "complete" elements that are checked in the form. Their element names are all different, but they all start with "complete_", so I created the following XPath expression to do this:
count(following::*[starts-with(name(), "my:complete") and . = 1])
This correctly counts any element who's name starts with the string "complete" and is equal to 1.
When I give a field this formula as its default value, the value gets set properly when the form opens. The problem is that it does not update as the form changes, even though I have the "Update this value when the result of the formula is recalculated" option checked off. I would expect this to update when I check complete_1, complete_2, etc.
Can anyone help?
Thanks in advance!