Hi,
Yes, You need to wroite the code to in Load event to load the Infopath form
and then get the field value you want use.

Signature
k.Ramana Reddy
http://www.GGKtech.com
> so, where I have to write the code,
> Tools -> Programming-> loading event
[quoted text clipped - 18 lines]
> > >
> > > Thanks in advance
swathi - 01 Aug 2007 20:10 GMT
How to write code for this task????
> Hi,
>
[quoted text clipped - 23 lines]
> > > >
> > > > Thanks in advance
swathi - 05 Aug 2007 04:24 GMT
I tried the following code.
try
{
string strCustID = e.InputParameters["CustID"];
DataSource dsCustomers = this.DataSources["GetCustID"];
XmlNamespaceManager ns = this.NamespaceManager;
XPathNavigator xnCustomer = dsCustomers.CreateNavigator();
XPathNavigator xnCustomer =
xnCustomer.SelectSingleNode("/dfs:myFields/dfs:queryFields/tns:Customers/tns:CustomerID");
xnCustomer.SetValue(CustomerID);
dsCustomer.QueryConnection.Execute();
}
catch (exception e)
{
MessageBox.Show(e.message,"Error");
}
but encountered the following error:
System.Collections.Generic.KeyNotFoundException was unhandled by user code
Message="The given key was not present in the dictionary."
Source="mscorlib"
StackTrace:
at System.ThrowHelper.ThrowKeyNotFoundException()
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at
Microsoft.Office.InfoPath.Internal.ReadOnlyDictionary`2.System.Collections.Generic.IDictionary<K,V>.get_Item(K key)
at customer_Checklist.FormCode.FormEvents_Loading(Object sender,
LoadingEventArgs e)
at
Microsoft.Office.InfoPath.Internal.FormEventsHost.OnLoad(DocReturnEvent
pEvent)
at
Microsoft.Office.Interop.InfoPath.SemiTrust._XDocumentEventSink2_SinkHelper.OnLoad(DocReturnEvent pEvent)
Is this the process for transferring the value of a field from one infopath
to another infopath.
Thanks in Advance
> Hi,
>
[quoted text clipped - 23 lines]
> > > >
> > > > Thanks in advance