This is from the Microsoft InfoPath 2003 help:
quote:
To access an XDocument object contained in the XDocuments collection, you can pass the positional index or the location path to the Item method:
var objXDoc;
objXDoc = Application.XDocuments(0);
// or...
objXDoc = Application.XDocuments("C:\\MyForm.xml");
So, for example, XDocuments(0) is your current form. If you know there are only two forms open, then the other form would be XDocuments(1) -- however, I would never rely on the user only having a cerain number of forms open.
Once you have your objXDoc set and pointing to the other form, you would get and set field values just the same as you would in your own current form.
Current form:
XDocument.DOM.selectSingleNode("/XPathToNode").text = "Some Value";
Other form:
var objXDoc = Application.XDocuments(1);
objXDoc.DOM.selectSingleNode("/XPathToNodeInOtherForm").text = "Some Value";