Using Infopath 2007, VB code
Hi,
I have a button on one view which adds a column to a repeating section when clicked, which works fine. What I now want it to do is add to the first repeating section, then switch views and add to a different repeating section. The goal of this is that the second repeating section will have the same number of sections as the first, so that one field from the first section can be displayed in the second section with additional rows of data.
I have been trying the code below...
' add to first section then switch views
CurrentView.ExecuteAction(ActionType.XCollectionInsert, "SampleInfo_54")
Me.ViewInfos.SwitchView("Lab Content")
' add to second section then switch back to original view
CurrentView.ExecuteAction(ActionType.XCollectionInsert, "group4_64")
Me.ViewInfos.SwitchView("Requestor Content")
The error occurs as it tries to add to the second section, with the following error: "The form's code contains errors. The following call in the form's code failed: View.ExecuteAction Unknown name."
I'm confused as when I put the second piece of code onto a separate button it adds to the second section without any errors, I just can't do both from the one button on the first view.
I'm new to Infopath, so any help would be greatly appreciated!
Cheers,
Richard