Why don't you implement the onAfterChange() event (on Pay# control) to populate the necessary after the Pay# field has been changed? It would look something like this:
function msoxd_my_PayNumber::OnAfterChange(eventObj)
{
var payNum = Math.parseInteger(eventObj.Site.text);
var date = secondary_data_source_DOM.selectSingleNode( "\\ns:date[ns:PayNum = " + payNum + "]" );
var settle = secondary_data_source_DOM.selectSingleNode( "\\ns:date[ns:PayNum = " + payNum + "]" );
XDocument.DOM.selectSingleNode( "\\my:date" ).text = date;
XDocument.DOM.selectSingleNode( "\\my:settlementPeriod" ).text = settle;
}
How did you create your XML secondary data source? It looks like you have <Date> nodes with several attributes, instead of sub-nodes. Is this correct XML format? If it is, it doesn't seem very effecient. You should structure your XML more like this:
<Date>
<PayNum>22</PayNum>
<Weekending>21/10/05</Weekending>
<StlPer>1<StlPer>
</Date>
Hope this helps....
---------------
Matt Faus
Matt Faus / Microsoft InfoPath MVPQdabra® Software / Streamline data gathering to turn process into knowledge