Jimmy:
You can add a row to a repeating table with the following single line of code:
XDocument.View.ExecuteAction("xCollection::insert", "group2_1")
just replace group2_1 with the XMLToEdit value found on the Advanced tab of the repeating table's properties.
When I try this I get the following unhelpful error:
The following error occured:
InfoPath has encountered an error. The operation failed.
The form's code contains an error.
The following call in the form's code failed: View.ExecuteAction
Unspecified error
The line that causes the fault is: XDocument.View.ExecuteAction "xCollection::insert", "UID_4"
(There are no parenthesis because this form was developed using VBS)
I have absolutely no idea what this could mean. The only things I can think that might affect it are that I have only just switched to the view when I try to call it... and UID_4 is a repeating section within another repeating section.