Still struggling with this... some more information
http://blog-sharepoint.blogspot.com/2009/07/summary-how-to-programmatically-update.html
http://blog-sharepoint.blogspot.com/2009/07/infopath-update-repeating-elementsnodes.html
I've followed through the guides and comments within the guides listed above. The most helpful part was the comments. I was able to follow them through to the end, however the desired functionality isn't achieved...
Here's the code that I use:
'Load the XML Document of the repeating data source
Dim xmlDataSource
Dim UpdateXML
Set xmlDataSource = XDocument.GetDOM("camlstats")
Set UpdateXML = xmlDataSource.selectNodes("/Batch/Method/Field")
'This loops through the repepeating element in the data source and
'sets the value of the repeating field if the name attribute matches
'the first param: XMLFieldName.
'the sourceField param accepts a string containing the XPath to the
'field which has the value which is to be set as
'the value of the required repeating element.
Sub updateXMLDataSource(XMLFieldName, sourceField)
Dim count
Dim DSNode
'Loop through each element in the data source to find the
'required field in the CAML template
For count = 0 To UpdateXML.length -1
'Test if the name attribute of the current
'element matches the required field
If UpdateXML(count).getAttribute("Name") = XMLFieldName Then
'Element Found: Update the value of current
'element to the value of souceField parameter (XPATH)
Set DSNode = XDocument.DOM.selectSingleNode(sourceField)
UpdateXML(count).text = DSNode.text
End If
Next
End Sub
Sub XDocument_OnLoad(eventObj)
' Write your code here
End Sub
'=======
' The following function handler is created by Microsoft Office InfoPath.
' Do not modify the name of the function, or the name and number of arguments.
'=======
Sub CTRL16_5_OnClick(eventObj)
dim MyField
For count = 0 To UpdateXML.length -1
MyField = UpdateXML(count).getAttribute("Name")
Msgbox MyField
MsgBox UpdateXML(count).text
Next
Dim Items
Set SharePointDataSource = XDocument.GetDOM("Network Access Form Statistics-viewonly")
SharePointDataSource.setProperty "SelectionNamespaces", "xmlns:dfs=""http://schemas.microsoft.com/office/infopath/2003/dataFormSolution"""
Set Items = SharePointDataSource.selectNodes("/dfs:myFields/dfs:dataFields/dfs:Network_Access_Form_Statistics")
MsgBox Items.Length 'returns correct number -- 2
For count = 0 to Items.Length - 1
MsgBox Items(count).selectSingleNode("//@Title").Text 'returns the first title twice, but not second
Next
Call updateXMLDataSource("Year", "/my:myFields/my:updatetext")
End Sub
'=======
' The following function handler is created by Microsoft Office InfoPath.
' Do not modify the name of the function, or the name and number of arguments.
'=======
Sub CTRL18_5_OnClick(eventObj)
XDocument.DataAdapters("Store Lists on SP").Submit
End Sub
=======================================================================
This loop:
For count = 0 To UpdateXML.length -1
MyField = UpdateXML(count).getAttribute("Name")
Msgbox MyField
MsgBox UpdateXML(count).text
Next
The first MsgBox successfully displays the column names noted in the caml.xml above.
The second MsgBox displays nothing.
=======================================================================
This loop:
For count = 0 to Items.Length - 1
MsgBox Items(count).selectSingleNode("//@Title").Text 'returns the first title twice, but not second
Next
Displays the first row's "Title" data for however many total rows there are, however it does not successfully display each row's title data, only the first.
=======================================================================
I'm going to continue using Google to search how to update a SP 2007 list via IP 2003 using VB. If anyone has successfully been able to do this I would greatly appreciate some guidance!