I have an InfoPath form with an XML datasource which lists all hospitals in the country. On the main tab there is a drop-down for the region you are in. My XML datasource is formatted like this:
<HOSPITAL Region="Region Name" Zone="#" name="Hospital Name"/>
Once a user chooses the region, there is a tab for Hospital Access on which they can choose the Zone# and then pick facilities. There is a repeating table with column 1 housing the Zones as a drop-down list and column 2 housing the facilities as a multiple selection list box.
My users don't want to to "Click Here to Insert Another Row" when they need to pick another Zone in the repeating table. Right now, they click here and they can choose another Zone # and the list box populates with all hospitals in that zone.
Is there anyway to populate those rows with the Zones from each region automatically when a region is chosen? I still want them to be able to change the Region selected and have the Zones refresh, but I need a way to add those rows programmatically for them. Each Region has a different number of zones, btw.
I saw this link from another post: http://www.infopathdev.com/blogs/jimmy/archive/2009/03/06/automatically-adding-rows-to-repeating-sections.aspx
However, I wasn't able to get it working in my form. I am using VB and tried using this line, but I'm not sure if this is the wrong track... Any help is greatly appreciated.
Here's the code I'm using now:
Public Sub repeatinGroup_142()CurrentView.ExecuteAction(ActionType.XCollectionInsert, "repeatingGroup_142")
End Sub