Looping through repeating table - InfoPath Dev
in

InfoPath Dev

Looping through repeating table

Last post 11-07-2010 10:37 AM by Jose9Reyes. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 11-07-2010 09:34 AM

    Looping through repeating table

    This has probably been answered a billion times before but I have not been able to jump this hurdle. :( Im in need of some serious help. I have a infopath form with a repeating table. Now I want to be able to read all the values in each row for the repeating table. At the moment Im using the following code: [CODE] Dim field1 As String Dim domNav As XpathNavigator = CreateNavigator() Dim rows As XpathNodeIterator = domNav.Select( _ "/dfs:myFields/dfs:dataFields/d:tblSite/d:tblCctv/d:tblDVR", NamespaceManager) While rows.MoveNext() field1 = rows.Current.SelectSingleNode("/dfs:myFields/dfs:dataFields/d:tblSite/d:tblCctv/d:tblDVR/@DVRType", NamespaceManager).toString End while [/CODE] I know it is going through the loop correctly as I tested it with a variable to count how many times it goes through, but when I test it tried to read the first field in each row its always the first rows first field which prints.
  • 11-07-2010 09:56 AM In reply to

    Re: Looping through repeating table

    I cant even write the code properly in this forum. :( Help is urgently required. :(
  • 11-07-2010 10:16 AM In reply to

    Re: Looping through repeating table

    You need to use a relative XPath in your SelectSingleNode() statement: "@DVRType"

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 11-07-2010 10:37 AM In reply to

    Re: Looping through repeating table

    Just tried that and it worked, thank you so much Jimmy.

Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.