Looping through repeating section - InfoPath Dev
in

InfoPath Dev

Looping through repeating section

Last post 12-08-2009 07:28 AM by Bill . 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 12-08-2009 07:09 AM

    • Bill
    • Top 200 Contributor
      Male
    • Joined on 09-26-2006
    • USA
    • Posts 57

    Looping through repeating section

    Hello,

    I have this small prodcedure that loops through a repaeting section.  However, I seem to be missing something something obvious that I cannot see.  It never advances to the next node in the repeating section, so if I attempt to use the data from the section, I always get the data from the first row in the repeating section.

    Any help would be appreciated.

    Code:

    Dim CISection As DOMNodeList

    Dim CIField As DOMNode

    CISection = thisXDocument.DOM.selectNodes("/dfs:myFields/dfs:dataFields/d:App1171/d:DHS1171_Application/d:DHS1171_HouseholdMember/d:DHS1171_SelfEmploymentIncome")

    CIField = CISection.nextNode()

    For cnt As Integer = 0 To CISection.length - 1writeval = CIField.selectSingleNode("/dfs:myFields/dfs:dataFields/d:App1171/d:DHS1171_Application/d:DHS1171_HouseholdMember/d:DHS1171_SelfEmploymentIncome/@GrossIncome").text

    MsgBox(writeval)

    CIField = CISection.nextNode()

    Next

     

     

     

     

    William L Fringer
    Database Administrator/Systems Integration Specialists

    L & S Associates, Inc.
    Michigan State University Corporate Research Park

    1-800-766-6185, ext 2076
  • 12-08-2009 07:18 AM In reply to

    Re: Looping through repeating section

     This is happening because you're using absolute XPath.  Try using

    writeval = CIField.selectSingleNode("@GrossIncome").text

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 12-08-2009 07:28 AM In reply to

    • Bill
    • Top 200 Contributor
      Male
    • Joined on 09-26-2006
    • USA
    • Posts 57

    Re: Looping through repeating section

    Thanks Jimmy that worked!!!

    William L Fringer
    Database Administrator/Systems Integration Specialists

    L & S Associates, Inc.
    Michigan State University Corporate Research Park

    1-800-766-6185, ext 2076
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.