Are you opening the second infopath form from within the first
infopath form?
Are you using Javascript or managed code (like C#)?
If you are opening the second form from within the first and are using
C# then you could try the following:
// The following function handler is created by Microsoft Office
InfoPath. Do not
// modify the type or number of arguments.
[InfoPathEventHandler(MatchPath="btnCopy",
EventType=InfoPathEventType.OnClick)]
public void btnCopy_OnClick(DocActionEvent e)
{
// copy current document's XML
IXMLDOMDocument newDoc = thisXDocument.DOM;
// manipulate the data in the copy
newDoc.documentElement.selectSingleNode("/my:myFields/my:field1").text
= "test";
newDoc.documentElement.selectSingleNode("/my:myFields/my:field2").text
= "1";
newDoc.documentElement.selectSingleNode("/my:myFields/my:field3").text
= "test2";
// get the path of the template
string strTemplatePath = getTemplatePath();
// call NewSolutionWithData to open a new Form and load the XML
thisApplication.XDocuments.NewFromSolutionWithData(newDoc.documentElement,
strTemplatePath, (int)XdDocumentVersionMode.xdFailOnVersionOlder);
thisApplication.XDocuments.Close(0);
}
What this does is on the onclick event of a button on the form,
creates a copy of the XML in the document, then manipulates the data
in the copied XML (effectively passing the parameter), then creates a
new instance of InfoPath with the modified (populated) XML.
You could then in your onload event of the form have it use the value
of the node you populated to query a data source to populate other
fields, for example if you passed in an Order ID or such.
Hope this helps.
Michelle Beall