>Hi, Is there any way to show the correct count of records for a repeating
>table with no records in it yet. example Number of Check shows as 1 instead
>of 0 in the form as well as when submitted to the database even though no
>data was entered for checks.
>
>Thanks
Mike,
The count you are seeing is correct because InfoPath is counting the
number of rows/cells in the repeating table.
So you need a formula that counts cells that are not empty. So you
need an XPath predicate that only matches cells/rows with the
particular data empty.
Something like this should do it for a single cell bound to field3 in
the row being empty:
count(../my:group1/my:group2/my:field3[not(. = "")])
Andrew Watt
MVP - InfoPath
Andrew Watt [MVP - InfoPath] - 06 Dec 2004 09:21 GMT
>>Hi, Is there any way to show the correct count of records for a repeating
>>table with no records in it yet. example Number of Check shows as 1 instead
[quoted text clipped - 18 lines]
>Andrew Watt
>MVP - InfoPath
Should be NOT empty in the line before the XPath formula.
Andrew Watt
MVP - InfoPath
Mike - 06 Dec 2004 14:09 GMT
Thanks Andrew, it worked perfectly. I also found out that there is a filter
wizard when entering formulas.
Mike
> >Hi, Is there any way to show the correct count of records for a repeating
> >table with no records in it yet. example Number of Check shows as 1 instead
[quoted text clipped - 18 lines]
> Andrew Watt
> MVP - InfoPath