quote:
Originally posted by anotherchrisberry
But...
Does anyone know how to get the "supporting" form to pass data back to the original form?
Well, I just have found the same problem. I solved it using Application object and XDocuments collection. So the problem is how to pair two forms in order to the latter form knows the destination for returning data.
Let's both forms (main and supporting) have an attribute that keeps the former (main) form's Id, which can be generated by anyway. I set this value when the supporting form is created. The supporting form is awared of the main form's DOM structure. When it is time to return data, the supporting form is looking for the required form in Application.XDocuments collection by checking the Id attribute.
For demo purpose, I supposed that we have only two forms and no need to search in Application.XDocuments collection. So we can use the main form number as the form Id. So the latter form executes the following code before it is closed:
objSource = Application.XDocuments(SourceId); // SourceId is 0.
//We don't need to search for the Source as we have only two forms running.
objSource.DOM.selectSingleNode("/my:myFields/my:Name").text =
XDocument.DOM.selectSingleNode("/my:myFields/my:field1").text;
Application.ActiveWindow.Close(true);
Well I am a newbie in Infopath and am not sure that's the best solution. Hope others could offer other ways.