I have a couple individual text boxes and a repeating table with two corresponding fields.
When I click a button I want to take those two values in the text boxes and insert them into the repeating table. This will be done several times per form.
Here is some code I put together just trying to make it work. It's moving the values to the repeating table but each time I click the button it just overwrites the first line and never creates a new line. I know I'm missing a big part of moving nodes but not sure where to go from here to do that.
As an added note, I'm using Infopath 2010.
Public Sub btnAddItem_Clicked(ByVal sender As Object, ByVal e As ClickedEventArgs)
Dim addXpath As XPathNavigator = MainDataSource.CreateNavigator().SelectSingleNode("my:myFields", NamespaceManager)Dim addWOField As XPathNavigator = MainDataSource.CreateNavigator().SelectSingleNode("my:myFields/my:addWO", NamespaceManager)
Dim addSerialField As XPathNavigator = MainDataSource.CreateNavigator().SelectSingleNode("my:myFields/my:addSerial", NamespaceManager)Dim manifest As XPathNavigator = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:group1/my:group2", NamespaceManager) manifest.SelectSingleNode("my:WoNum", NamespaceManager).SetValue(addWOField.Value)manifest.SelectSingleNode("my:serial", NamespaceManager).SetValue(addSerialField.Value)
addXpath.SelectSingleNode(
"my:addWO", NamespaceManager).SetValue("")addXpath.SelectSingleNode("my:addSerial", NamespaceManager).SetValue("") End Sub