<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Pass Parameter to an unopened form</title><link>https://www.infopathdev.com:443/forums/thread/39410.aspx</link><pubDate>Wed, 11 Mar 2009 15:00:55 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:39410</guid><dc:creator>Svetoslav</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/39410.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=39410</wfw:commentRss><description>&lt;p&gt;Hello all, &lt;/p&gt;
&lt;p&gt;&amp;nbsp;The method works just perfect. I have achieved my purpose. It was a stupid mistake that I havent updated my second(the new) form, and so the Xpath was not correct. Sorry for bothering you! &lt;/p&gt;
&lt;p&gt;I am very grateful for this site, that it provides perfect solutions to not so advanced users. &lt;/p&gt;
&lt;p&gt;P.S. I hope I will become :) &lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Svetoslav &lt;/p&gt;</description></item><item><title>Re: Pass Parameter to an unopened form</title><link>https://www.infopathdev.com:443/forums/thread/39408.aspx</link><pubDate>Wed, 11 Mar 2009 14:38:30 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:39408</guid><dc:creator>Svetoslav</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/39408.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=39408</wfw:commentRss><description>&lt;p&gt;Hello &lt;strong&gt;nukkumatti, &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I was reading this topic, because I have a similar problem. As a matter of fact I tried your code ( the 1st solution that you proposed) and it worked perfectly ( with my&amp;nbsp; variables). After that I used this method in my IP form, but it kept showing me an error message &amp;quot;&amp;quot;. I am posting now my code: &lt;/p&gt;
&lt;p&gt;function CTRL90_5::OnClick(eventObj) &lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;&amp;nbsp;var secondFile = Application.XDocuments.NewFromSolution(&amp;quot;Template location&amp;quot;); //the new&amp;nbsp;template location on SharePoint&lt;/p&gt;
&lt;p&gt;var crNumber = XDocument.DOM.selectSingleNode(&amp;quot;/my:myCR/my:crForm/my:crNumberInit&amp;quot;).text; //the value on the 1st form,that I have to pass to the new o&amp;nbsp;&lt;/p&gt;
&lt;p&gt;var aiID = secondFile.DOM.selectSingleNode(&amp;quot;/my:myAI/my:aiNumber&amp;quot;); //the place in the new form where i place the above value&lt;/p&gt;
&lt;p&gt;aiID.text=crNumber;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;}&lt;/p&gt;
&lt;p&gt;It seems that now it cannot select the field in the new form. It opens the new form, as well as select the the crNumber variable. But the last line gives me the error: &amp;quot; null &amp;quot; is null or not an object. From my point of view the error is that the variable aiID is not located by the XPath. It is very strange for me because the same method but with different variable name and Xpath worked perfect&amp;nbsp;(for the Xpath&amp;nbsp; in this case I am sure that it correct). I am lost ... I need some help.&lt;/p&gt;
&lt;p&gt;Best regards, &lt;/p&gt;
&lt;p&gt;Svetoslav &lt;/p&gt;</description></item><item><title>Re: Pass Parameter to an unopened form</title><link>https://www.infopathdev.com:443/forums/thread/19280.aspx</link><pubDate>Sat, 21 Apr 2007 02:27:25 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:19280</guid><dc:creator>troy0118</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/19280.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=19280</wfw:commentRss><description>&lt;p&gt;Thanks for reply.&lt;/p&gt;&lt;p&gt;Two forms are required. The screenshots you see are not for real. It&amp;#39;s just my sample database.&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Pass Parameter to an unopened form</title><link>https://www.infopathdev.com:443/forums/thread/19274.aspx</link><pubDate>Fri, 20 Apr 2007 17:52:47 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:19274</guid><dc:creator>Clay Fox</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/19274.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=19274</wfw:commentRss><description>&lt;p&gt;Just catching up on this thread but I thought I would throw out an idea that might simplify this solution. From what I see in the screen shots, you are making it more complicated than it may need to be by having two forms.&lt;/p&gt;&lt;p&gt;It appears you have two tables of data, one for Name and ID and the other for ID and Salary. Are these in a database? If so you could just use the table relationships and put it all in one form.&amp;nbsp;&amp;nbsp;&amp;nbsp; You can have one table as your main and then add an additional table with the ID as the key relationship.&amp;nbsp; This allows you to update either table, query, etc.&lt;/p&gt;&lt;p&gt;Otherwise, I am not sure which list you are modifying, if at all but if the lists are not large you could load both and use filtering to view the appropriate records.&lt;/p&gt;&lt;p&gt;&amp;nbsp;Just thought I would throw that out, maybe you have other requirements that is justifying having two forms instead of one with multiple views, etc.&lt;/p&gt;</description></item><item><title>Re: Pass Parameter to an unopened form</title><link>https://www.infopathdev.com:443/forums/thread/19269.aspx</link><pubDate>Fri, 20 Apr 2007 15:55:12 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:19269</guid><dc:creator>troy0118</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/19269.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=19269</wfw:commentRss><description>&lt;p&gt;Thanks, nukkumatti.&lt;/p&gt;&lt;p&gt;I did the same thing you did before. I copied the namespace from Salary form, but it generated error by saying duplicate definition.&lt;/p&gt;&lt;p&gt;I must have done something wrong. Could you please tell me when I deal with namespace, what should I focus on to avoid such mistakes?&lt;/p&gt;&lt;p&gt;Again, thank you very much.&lt;/p&gt;&lt;p&gt;Troy&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Pass Parameter to an unopened form</title><link>https://www.infopathdev.com:443/forums/thread/19235.aspx</link><pubDate>Fri, 20 Apr 2007 08:10:22 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:19235</guid><dc:creator>nukkumatti</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/19235.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=19235</wfw:commentRss><description>BTW - You can get the namespace definition form the script editor of your second form or use a method calles something like getNamespace, not sure though. Have fun with further development and keep on posting your questions.</description></item><item><title>Re: Pass Parameter to an unopened form</title><link>https://www.infopathdev.com:443/forums/thread/19233.aspx</link><pubDate>Fri, 20 Apr 2007 07:26:55 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:19233</guid><dc:creator>nukkumatti</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/19233.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=19233</wfw:commentRss><description>&lt;p&gt;Hi Troy,&lt;/p&gt;&lt;p&gt;I received your eMail. Don&amp;#39;t get me wrong now but please stop sending me eMails. I help people in this forum voluntarily and post questions and answers only when I have time for it as I also have a regular job. The mail address is mainly used to get in contact with Patrick or his team. This forum is just great and in my oppinion the best reference you can have regarding some infopath issues, better than any book. You cannot expect that other people do the work for you, usually you had to pay money for that extensive help. There is a bunch of information arround and with a little more investigation you could may be have figured out your problem alone.&lt;/p&gt;&lt;p&gt;Anyway I had a look on your forms and now it was obvious what was wrong. You need to make your current form aware of the namespace prefixes which are coming form your second form otherwise your active form cannot interpret the &amp;quot;:dfs&amp;quot; for example.&lt;/p&gt;&lt;p&gt;So here is the code you need:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;var toPass = XDocument.DOM.selectSingleNode(&amp;quot;dfs:myFields/dfs:dataFields/d:Name/@id&amp;quot;).text;&amp;nbsp; &lt;br /&gt;var salary = Application.XDocuments.NewFromSolution(&amp;quot;C:\\Temp\\Salary.xsn&amp;quot;);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;salary.DOM.setProperty(&amp;quot;SelectionNamespaces&amp;quot;, &amp;#39;xmlns:xsi=&amp;quot;&lt;a href="http://www.w3.org/2001/XMLSchema-instance"&gt;http://www.w3.org/2001/XMLSchema-instance&lt;/a&gt;&amp;quot; xmlns:q=&amp;quot;&lt;a href="http://schemas.microsoft.com/office/infopath/2003/ado/queryFields"&gt;http://schemas.microsoft.com/office/infopath/2003/ado/queryFields&lt;/a&gt;&amp;quot; xmlns:d=&amp;quot;&lt;a href="http://schemas.microsoft.com/office/infopath/2003/ado/dataFields"&gt;http://schemas.microsoft.com/office/infopath/2003/ado/dataFields&lt;/a&gt;&amp;quot; xmlns:dfs=&amp;quot;&lt;a href="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution"&gt;http://schemas.microsoft.com/office/infopath/2003/dataFormSolution&lt;/a&gt;&amp;quot; xmlns:my=&amp;quot;&lt;a href="http://schemas.microsoft.com/office/infopath/2003/myXSD/2007-04-18T13:37:36"&gt;http://schemas.microsoft.com/office/infopath/2003/myXSD/2007-04-18T13:37:36&lt;/a&gt;&amp;quot; xmlns:xd=&amp;quot;&lt;a href="http://schemas.microsoft.com/office/infopath/2003&amp;quot;&amp;#39;"&gt;http://schemas.microsoft.com/office/infopath/2003&amp;quot;&amp;#39;&lt;/a&gt;);&lt;/p&gt;&lt;p&gt;salary.DOM.selectSingleNode(&amp;quot;dfs:myFields/dfs:queryFields/q:Salary/@id&amp;quot;).text = toPass;&lt;/p&gt;</description></item><item><title>Re: Pass Parameter to an unopened form</title><link>https://www.infopathdev.com:443/forums/thread/19215.aspx</link><pubDate>Thu, 19 Apr 2007 14:50:33 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:19215</guid><dc:creator>troy0118</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/19215.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=19215</wfw:commentRss><description>&lt;p&gt;I sent an email to you. I think you probably didn&amp;#39;t notice it. If you can give me your email address, I can send you the sample I am working on. I think it&amp;#39;s better.&lt;/p&gt;&lt;p&gt;This is the data structure. It&amp;#39;s kind of simple because this is just a sample database.&lt;/p&gt;&lt;p&gt;&lt;img height="214" src="http://i170.photobucket.com/albums/u274/cobol29/structure.jpg" width="591" /&gt;&lt;/p&gt;</description></item><item><title>Re: Pass Parameter to an unopened form</title><link>https://www.infopathdev.com:443/forums/thread/19208.aspx</link><pubDate>Thu, 19 Apr 2007 07:47:53 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:19208</guid><dc:creator>nukkumatti</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/19208.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=19208</wfw:commentRss><description>&lt;p&gt;Hey Troy,&lt;/p&gt;&lt;p&gt;&amp;nbsp;please post&amp;nbsp;the structure for your second forms&amp;nbsp;datasource so that we may find out the xPath together. Sorry that my posts have always a big delay but we are in two completey different time zones.&lt;/p&gt;</description></item><item><title>Re: Pass Parameter to an unopened form</title><link>https://www.infopathdev.com:443/forums/thread/19189.aspx</link><pubDate>Wed, 18 Apr 2007 20:10:03 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:19189</guid><dc:creator>troy0118</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/19189.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=19189</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;&lt;p&gt;It doesn&amp;#39;t work.&lt;/p&gt;&lt;p&gt;var Topass = XDocument.DOM.selectSingleNode(&amp;quot;/dfs:myFields/dfs:dataFields/d:Name/@id&amp;quot;).text;&lt;br /&gt;var Salary = Application.XDocuments.NewFromSolution(&amp;quot;C:\\Temp\\Salary.xsn&amp;quot;);&lt;br /&gt;Salary.DOM.selectSingleNode(&amp;quot;/my:myFields/my:id&amp;quot;).text = Topass;&amp;nbsp; &amp;lt;= Still got error message from this line.&lt;br /&gt;&amp;quot;&amp;nbsp; Reference to undeclared namespace prefix: &amp;#39;my&amp;#39;.&amp;nbsp; &amp;quot;&lt;/p&gt;&lt;p&gt;The following is my sample database.&lt;/p&gt;&lt;p&gt;&lt;table cellpadding="0" cellspacing="0" class="MsoTableGrid" style="border-collapse:collapse;border:medium none;"&gt;&lt;tr&gt;&lt;td style="padding-right:5.4pt;padding-left:5.4pt;padding-bottom:0in;width:1.45in;padding-top:0in;background-color:transparent;border:windowtext 1pt solid;"&gt;&lt;table align="left" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="background:white;margin:auto 6.75pt;"&gt;&lt;tr&gt;&lt;td colspan="2" style="background:silver;border:#ece9d8;padding:0.75pt;"&gt;&lt;p align="center" class="MsoNormal" style="margin:0in 0in 0pt;text-align:center;"&gt;&lt;font size="3"&gt;&lt;strong&gt;&lt;span style="color:black;font-family:Arial;"&gt;Name&lt;/span&gt;&lt;/strong&gt;&lt;span style="color:black;font-family:Arial;"&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="background:silver;border:black 1pt inset;padding:0.75pt;"&gt;&lt;p align="center" class="MsoNormal" style="margin:0in 0in 0pt;text-align:center;"&gt;&lt;strong&gt;&lt;span style="font-size:10pt;color:black;font-family:Arial;"&gt;id&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="background:silver;border:black 1pt inset;padding:0.75pt;"&gt;&lt;p align="center" class="MsoNormal" style="margin:0in 0in 0pt;text-align:center;"&gt;&lt;strong&gt;&lt;span style="font-size:10pt;color:black;font-family:Arial;"&gt;name&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="background-color:transparent;border:silver 1pt inset;padding:0.75pt;"&gt;&lt;p align="right" class="MsoNormal" style="margin:0in 0in 0pt;text-align:right;"&gt;&lt;span style="font-size:10pt;color:black;font-family:Arial;"&gt;1&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="background-color:transparent;border:silver 1pt inset;padding:0.75pt;"&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;span style="font-size:10pt;color:black;font-family:Arial;"&gt;Jack&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="background-color:transparent;border:silver 1pt inset;padding:0.75pt;"&gt;&lt;p align="right" class="MsoNormal" style="margin:0in 0in 0pt;text-align:right;"&gt;&lt;span style="font-size:10pt;color:black;font-family:Arial;"&gt;2&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="background-color:transparent;border:silver 1pt inset;padding:0.75pt;"&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;span style="font-size:10pt;color:black;font-family:Arial;"&gt;Jason&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="background-color:transparent;border:silver 1pt inset;padding:0.75pt;"&gt;&lt;p align="right" class="MsoNormal" style="margin:0in 0in 0pt;text-align:right;"&gt;&lt;span style="font-size:10pt;color:black;font-family:Arial;"&gt;3&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="background-color:transparent;border:silver 1pt inset;padding:0.75pt;"&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;span style="font-size:10pt;color:black;font-family:Arial;"&gt;John&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&amp;nbsp;&lt;/p&gt;&lt;/td&gt;&lt;td style="border-right:windowtext 1pt solid;padding-right:5.4pt;border-top:windowtext 1pt solid;padding-left:5.4pt;padding-bottom:0in;border-left:#ece9d8;width:1.45in;padding-top:0in;border-bottom:windowtext 1pt solid;background-color:transparent;"&gt;&lt;table align="left" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="background:white;margin:auto 6.75pt;"&gt;&lt;tr&gt;&lt;td colspan="2" style="background:silver;border:#ece9d8;padding:0.75pt;"&gt;&lt;p align="center" class="MsoNormal" style="margin:0in 0in 0pt;text-align:center;"&gt;&lt;font size="3"&gt;&lt;strong&gt;&lt;span style="color:black;font-family:Arial;"&gt;Salary&lt;/span&gt;&lt;/strong&gt;&lt;span style="color:black;font-family:Arial;"&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="background:silver;border:black 1pt inset;padding:0.75pt;"&gt;&lt;p align="center" class="MsoNormal" style="margin:0in 0in 0pt;text-align:center;"&gt;&lt;strong&gt;&lt;span style="font-size:10pt;color:black;font-family:Arial;"&gt;id&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="background:silver;border:black 1pt inset;padding:0.75pt;"&gt;&lt;p align="center" class="MsoNormal" style="margin:0in 0in 0pt;text-align:center;"&gt;&lt;strong&gt;&lt;span style="font-size:10pt;color:black;font-family:Arial;"&gt;Salary&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="background-color:transparent;border:silver 1pt inset;padding:0.75pt;"&gt;&lt;p align="right" class="MsoNormal" style="margin:0in 0in 0pt;text-align:right;"&gt;&lt;span style="font-size:10pt;color:black;font-family:Arial;"&gt;1&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="background-color:transparent;border:silver 1pt inset;padding:0.75pt;"&gt;&lt;p align="right" class="MsoNormal" style="margin:0in 0in 0pt;text-align:right;"&gt;&lt;span style="font-size:10pt;color:black;font-family:Arial;"&gt;$500.00&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="background-color:transparent;border:silver 1pt inset;padding:0.75pt;"&gt;&lt;p align="right" class="MsoNormal" style="margin:0in 0in 0pt;text-align:right;"&gt;&lt;span style="font-size:10pt;color:black;font-family:Arial;"&gt;2&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="background-color:transparent;border:silver 1pt inset;padding:0.75pt;"&gt;&lt;p align="right" class="MsoNormal" style="margin:0in 0in 0pt;text-align:right;"&gt;&lt;span style="font-size:10pt;color:black;font-family:Arial;"&gt;$600.00&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="background-color:transparent;border:silver 1pt inset;padding:0.75pt;"&gt;&lt;p align="right" class="MsoNormal" style="margin:0in 0in 0pt;text-align:right;"&gt;&lt;span style="font-size:10pt;color:black;font-family:Arial;"&gt;3&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="background-color:transparent;border:silver 1pt inset;padding:0.75pt;"&gt;&lt;p align="right" class="MsoNormal" style="margin:0in 0in 0pt;text-align:right;"&gt;&lt;span style="font-size:10pt;color:black;font-family:Arial;"&gt;$700.00&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&amp;nbsp;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/p&gt;&lt;p&gt;What should I do? I am gonna&amp;nbsp;go crazy.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Pass Parameter to an unopened form</title><link>https://www.infopathdev.com:443/forums/thread/19181.aspx</link><pubDate>Wed, 18 Apr 2007 16:42:48 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:19181</guid><dc:creator>nukkumatti</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/19181.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=19181</wfw:commentRss><description>&lt;p&gt;Salary is the reference to your second form so you need to specify the xPath of the field of your second form in which you want to write the value of your first form. sorry but i can&amp;acute;t tell you your xPathes, my be it&amp;acute;s just (&amp;quot;my:myFields/my:Id&amp;quot;)&amp;nbsp; ?&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Pass Parameter to an unopened form</title><link>https://www.infopathdev.com:443/forums/thread/19178.aspx</link><pubDate>Wed, 18 Apr 2007 14:50:13 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:19178</guid><dc:creator>troy0118</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/19178.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=19178</wfw:commentRss><description>&lt;p&gt;Hi nukkumatti,&lt;/p&gt;&lt;p&gt;&amp;nbsp;Thanks again.&lt;/p&gt;&lt;p&gt;var Getid = XDocument.DOM.selectSingleNode(&amp;quot;dfs:myFields/dfs:dataFields/d:Name/@id&amp;quot;).text;&lt;br /&gt;var Salary = Application.XDocuments.NewFromSolution(&amp;quot;C:\\Temp\\Salary.xsn&amp;quot;);&lt;br /&gt;Salary.DOM.selectSingleNode(&amp;quot;dfs:myFields/dfs:queryFields/q:Salary/@id&amp;quot;).text = Getid;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ^^^ &amp;lt;= error message &amp;quot;Reference to undeclared namespace prefix: &amp;#39;dfs&amp;#39;&amp;quot;&lt;/p&gt;&lt;p&gt;Namespace defined in the form:&lt;br /&gt;XDocument.DOM.setProperty(&amp;quot;SelectionNamespaces&amp;quot;, xmlns:xsi=&amp;quot;&lt;a href="http://www.w3.org/2001/XMLSchema-instance"&gt;http://www.w3.org/2001/XMLSchema-instance&lt;/a&gt;&amp;quot;&lt;br /&gt;xmlns:q=&amp;quot;&lt;a href="http://schemas.microsoft.com/office/infopath/2003/ado/queryFields"&gt;http://schemas.microsoft.com/office/infopath/2003/ado/queryFields&lt;/a&gt;&amp;quot;&lt;br /&gt;xmlns:d=&amp;quot;&lt;a href="http://schemas.microsoft.com/office/infopath/2003/ado/dataFields"&gt;http://schemas.microsoft.com/office/infopath/2003/ado/dataFields&lt;/a&gt;&amp;quot;&lt;br /&gt;xmlns:dfs=&amp;quot;&lt;a href="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution%22&amp;#39;"&gt;http://schemas.microsoft.com/office/infopath/2003/dataFormSolution&amp;quot;&amp;#39;&lt;/a&gt;);&lt;/p&gt;&lt;p&gt;I got the xPath from expression box. The first one works, but not the second one.&lt;br /&gt;Why is that? I don&amp;#39;t get it.&lt;br /&gt;I am almost there. Please help me out.&lt;/p&gt;</description></item><item><title>Re: Pass Parameter to an unopened form</title><link>https://www.infopathdev.com:443/forums/thread/19136.aspx</link><pubDate>Tue, 17 Apr 2007 06:14:13 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:19136</guid><dc:creator>nukkumatti</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/19136.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=19136</wfw:commentRss><description>&lt;p&gt;I think you mix things up there.&amp;nbsp;&lt;/p&gt;&lt;p&gt;Okay again,&lt;/p&gt;&lt;p&gt;first you have a paramter from your active form which you want to pass to your second solution for example:&amp;nbsp;var parameterTopass = XDocument.DOM.selectSingleNode(&amp;quot;my:myFields/my:ID&amp;quot;).text; the xPath should&amp;nbsp;point to the drop down list&amp;nbsp;from your picture (on the left side)&amp;nbsp;where the ID is in. If&amp;nbsp;I&amp;nbsp;see this correct this is what you want to pass to the second solution.&amp;nbsp;&lt;/p&gt;&lt;p&gt;now you&amp;nbsp;need&amp;nbsp;a reference to your second solution you want to pass your parameter to: var SalarySolution = Application.XDocuments.NewFromSolution(&amp;quot;C.\\Temp\\Salary.xsn&amp;quot;);&lt;/p&gt;&lt;p&gt;now pass the paramter of your current solution to your second: SalarySolution.DOM.selectSingleNode(&amp;quot;dfs:myFields/dfs:dataFields/d:personal/@id&amp;quot;).text = parameterTopass; and again please verify that your xPath is correct there.&lt;/p&gt;</description></item><item><title>Re: Pass Parameter to an unopened form</title><link>https://www.infopathdev.com:443/forums/thread/19112.aspx</link><pubDate>Mon, 16 Apr 2007 15:58:12 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:19112</guid><dc:creator>troy0118</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/19112.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=19112</wfw:commentRss><description>&lt;p&gt;Hi&amp;nbsp;nukkumatti,&lt;/p&gt;&lt;p&gt;This is what I have now:&lt;br /&gt;&lt;font color="#ff0000"&gt;1. var SalarySolution = Application.XDocuments.NewFromSolution(&amp;quot;C:\\Temp\\Salary.xsn&amp;quot;);&lt;br /&gt;2. var getid = SalarySolution.DOM.selectSingleNode(&amp;quot;dfs:dataFields/d:personal/@id&amp;quot;).text;&lt;br /&gt;&lt;/font&gt;(However,&amp;nbsp;I still got the&amp;nbsp;error message &amp;quot;Reference to undeclared namespace prefix: &amp;#39;dfs&amp;#39;&amp;quot;)&lt;br /&gt;&lt;font color="#ff0000"&gt;3. getid.text = &amp;quot;id&amp;quot;;&lt;br /&gt;&lt;/font&gt;(Is this the way to pass the value to the id field on Form2?)&lt;/p&gt;&lt;p&gt;if we write var getid = xxxxxx.text (line2), then shouldn&amp;#39;t we have getid = &amp;quot;id&amp;quot; (line3)?&lt;/p&gt;</description></item><item><title>Re: Pass Parameter to an unopened form</title><link>https://www.infopathdev.com:443/forums/thread/19107.aspx</link><pubDate>Mon, 16 Apr 2007 11:48:12 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:19107</guid><dc:creator>nukkumatti</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/19107.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=19107</wfw:commentRss><description>&lt;p&gt;&lt;font face="Times New Roman" size="3"&gt;Hi you are on the right track.&lt;/font&gt;&lt;/p&gt;&lt;p&gt;First thing to try is replace (&amp;quot;\C:\\Temp\\Salary.xsn&amp;quot;) with (&amp;quot;C:\\Temp\\Salary.xsn&amp;quot;). I am not sure if your path is incorrect but for me it works without the firs &amp;quot;\&amp;quot;.&lt;/p&gt;&lt;p&gt;&lt;font color="#ff0000"&gt;var getid = SalarySolution.DOM.selectSingleNode(&amp;quot;/dfs:myFields/dfs:dataFields/d:personal/@id&amp;quot;).text;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;Yes this line is meant to get the value of the id field but I guess that just the xPath you are using is wrong.&amp;nbsp;A nice way to get the correct xPath is using expression boxes. Drop an exBox to your form and point it to the datasource of your ID drop down list control and then check the &amp;quot;Advanced edit xPath&amp;quot; box to get the correct xPath. This you can then use your selectSingleNode function and i guess everything should work. Also try there to leave the first &amp;quot;/&amp;quot;.&lt;/p&gt;&lt;p&gt;&amp;nbsp;Let me know if it helped.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>