retrieving value from repeated section - InfoPath Dev
in

InfoPath Dev

retrieving value from repeated section

Last post 03-16-2011 11:33 AM by gr8fasushi. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 03-16-2011 09:53 AM

    retrieving value from repeated section

    Hi guys, new infopath developer here and I'm running into a problem trying to access the value from a repeated section.  I'm sure it's very simple but it's eluding me at the moment.

     I currently have a form with a text box for a user to insert comments.  From what I understand, infopath won't communicate with a database directly if a field exceeds 255 characters, so I put the textbox in a repeated section so if they need to exceed 255, they can insert additional textboxes to complete their comment.  I can retrieve the first textbox value without a problem, however the 2nd textbox throws an error of "Object reference not set to an instance of an object. "

    Is it simply a syntax error?  I thought I could navigate the repeating sections by adding [1],[2],[3], etc to the end of the xpath.  It works for the first one [1] but not anything after.


                Dim IssueDescription As String = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:gIssueDescription/my:rsIssueDescription/my:tbIssueDescription[1]", NamespaceManager).Value
                Dim IssueDescription2 As String = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:gIssueDescription/my:rsIssueDescription/my:tbIssueDescription[2]", NamespaceManager).Value

     

    Also, is there a way to work around the 255 character limit without resorting to using webservices?

    I appreciate any input!

     

    thanks

  • 03-16-2011 10:39 AM In reply to

    Re: retrieving value from repeated section

    Most likely you need to put the [1], [2] after rsIssueDescription, not tbIssueDescription.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 03-16-2011 11:33 AM In reply to

    Re: retrieving value from repeated section

    a-ha! thank you, I knew it was a simple syntax error

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