Hi
Do you nned this in VB? There are way to to this out-of-the-box. All depends an how your datasource is structured. The fields you like to count, are they just fields under the root, or are they fields within a repeating node ?
The next example shows the xpath to calculated the percentage of how many lines were filled in correctly within a repeating node
So i éade an extra field ControlIsExecuted related to rules to be sure and gets Y as all fields are fillid in, otherwhise N
count(/my:expenseReport/my:MyControls/my:MyControl/my:ControlIsExecuted[text() = "Y"]) div count(/my:expenseReport/my:MyControls/my:MyControl) * 100
/my:expenseReport/my:MyControls/my:MyContro 0 repeating node
ControlIsExecuted = the fields i need to check
div = divide
I hope this directs you to a solution (outside VB)
Frederik Van Lierde
Blue InfoPath Blog ¦
SilverSands Associate ¦
Do you follow me already? ¦ We work smart, not hard
If this article was helpfull, don't forget to rate it, tnx!