Hi
I've been scouring the forum and elswhere for a solution to this for the past few days. All I need to do is add a blank row to a repeating table. The following code has been cribbed from other sources on the forum but I am having trouble getting it to work.
Sub msoxd_my_field1_OnAfterChange(eventObj)
'Add new row to repeating table programmatically
Dim newxmlstring, oXML, oParent
'Build XML needed for empty node
newxmlstring = "<my:group4><my:field1></my:field1></my:group4>"
'Create a new empty node
Set oXML = XDocument.CreateDOM()
oXML.loadXML(newxmlstring)
'Define Parent
Set oParent = XDocument.DOM.selectSingleNode("/my:myFields/my:group3/my:group4")
'set node 'Set oNode = oXML.documentElement
'Add new node to parent as XML
oParent.appendChild(oXML.documentElement) --------- code fails here Error: Invalid procedure call or argument
End Sub
Can anyone help or point me towards a solution?
Thanks
Gary