Lee,
Yes, you can do this. I have an InfoPathDev.com Example I've started, but haven't had time to finish and post yet that shows how to select a Master table row using code.
You will need to extract your form files and open the view .xsl file to get a piece of data for this to work.
Let's say you wanted to hook this code up to the Next Row button, it would look similar to this:
var oMasterTable = XDocument.DOM.selectSingleNode("//my:group1");
var iRow = parseInt(XDocument.GetNamedNodeProperty(oMasterTable, "CTRL1_5", 1));
XDocument.SetNamedNodeProperty(oMasterTable, "CTRL1_5", iRow + 1);Notes:
- The my:group1 would be replaced with the node for your Master Table.
- From the view .xsl file, you need to get the middle parameter. It can be found by doing a search for "GetNamedNodeProperty".
- The third parameter for Get... is the default value to use in case nothing is found.
- The third parameter for Set... is the value you want to set for this named node property.
- You'll need to special case the upper and lower bounds to make sure your don't go below 1 and above the row count.
Have fun, and let me know how it works and what you think!!
Greg Collins [InfoPath MVP]