<?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: newbie trying to populate Infopath fields</title><link>https://www.infopathdev.com:443/forums/thread/84845.aspx</link><pubDate>Wed, 28 Nov 2012 18:12:18 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:84845</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/84845.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=84845</wfw:commentRss><description>&lt;p&gt;Put an expression box on your form with the value of the field that is bound to the list box. I imagine you are setting the value, but that it is not corresponding to a selection in the list box. &lt;/p&gt;&lt;p&gt;What is happening with your field with validation?&amp;nbsp;I&amp;#39;d expect the validation to still be triggered if you set the field to an invalid value in your code.&lt;/p&gt;</description></item><item><title>Re: newbie trying to populate Infopath fields</title><link>https://www.infopathdev.com:443/forums/thread/84813.aspx</link><pubDate>Wed, 28 Nov 2012 03:25:04 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:84813</guid><dc:creator>thegoat</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/84813.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=84813</wfw:commentRss><description>&lt;p&gt;Hi Hilary,&lt;/p&gt;
&lt;p&gt;Yes, the link you provided had some examples which have worked for me. However I&amp;#39;m still having a couple of issues&lt;/p&gt;
&lt;p&gt;1) I can&amp;#39;t seem to populate fields that have been formatted as a &amp;#39;list box&amp;#39;. For example, this code works for all non-listbox textboxes:&lt;br /&gt;&lt;strong&gt;docInfoPath.DOM.SelectSingleNode(&amp;quot;//my:RequestTypeOther&amp;quot;).Text = &amp;quot;Test&amp;quot;&lt;br /&gt;&lt;/strong&gt;but when it tries to do that to a textbox that is formatted as a &amp;#39;list box&amp;#39;, nothing happens&lt;/p&gt;
&lt;p&gt;2) at least one field on the form has validation that runs after you exit the field. Is there anyway I can get that validation to run through code?&lt;/p&gt;</description></item><item><title>Re: newbie trying to populate Infopath fields</title><link>https://www.infopathdev.com:443/forums/thread/84811.aspx</link><pubDate>Wed, 28 Nov 2012 01:11:44 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:84811</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/84811.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=84811</wfw:commentRss><description>Oh, check this post, the code sample there may help you... &lt;a href="http://www.infopathdev.com/forums/p/801/3094.aspx"&gt;http://www.infopathdev.com/forums/p/801/3094.aspx&lt;/a&gt;</description></item><item><title>Re: newbie trying to populate Infopath fields</title><link>https://www.infopathdev.com:443/forums/thread/84810.aspx</link><pubDate>Wed, 28 Nov 2012 01:10:32 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:84810</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/84810.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=84810</wfw:commentRss><description>Okay - well, it looks like you are using vbscript? I&amp;#39;m more a managed code girl, so probably won&amp;#39;t be a ton of help there - you&amp;#39;ll need to get the XPath of the field you want to populate - what version of IP are you using?</description></item><item><title>Re: newbie trying to populate Infopath fields</title><link>https://www.infopathdev.com:443/forums/thread/84808.aspx</link><pubDate>Tue, 27 Nov 2012 23:50:22 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:84808</guid><dc:creator>thegoat</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/84808.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=84808</wfw:commentRss><description>&lt;p&gt;Hi Hilary,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Thanks so much for the quick reply. &lt;/p&gt;
&lt;p&gt;I don&amp;#39;t want to submit to an Access DB, but rather populate the form based on values in the DB. The form I&amp;#39;m trying to populate is used across the organisation in many different areas. The database I&amp;#39;m using to populate the form is used by a select group of people who use the form for a specific purpose, so I&amp;#39;d rather &amp;#39;push&amp;#39; the data from the database rather than modifying the form to &amp;#39;pull&amp;#39; the data.&lt;/p&gt;</description></item><item><title>Re: newbie trying to populate Infopath fields</title><link>https://www.infopathdev.com:443/forums/thread/84806.aspx</link><pubDate>Tue, 27 Nov 2012 23:35:01 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:84806</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/84806.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=84806</wfw:commentRss><description>&lt;p&gt;Hi - welcome!&lt;/p&gt;&lt;p&gt;You know if you want your form to query from and submit to an Access DB, you can just base the form off the DB - no code needed there. Or, if you just want to query, you could add a secondary data connection to query the DB. Any particular reason you are taking this approach?&lt;/p&gt;</description></item><item><title>newbie trying to populate Infopath fields</title><link>https://www.infopathdev.com:443/forums/thread/84804.aspx</link><pubDate>Tue, 27 Nov 2012 23:28:50 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:84804</guid><dc:creator>thegoat</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/84804.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=84804</wfw:commentRss><description>&lt;p&gt;Hi guys,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;So glad I came across this forum, hoping someone can help this newbie out!!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;I am trying to populate fields on an InfoPath form that someone else developed. I am using data from an Access database to populate the fields. I have never worked with InfoPath before.&lt;/p&gt;
&lt;p&gt;So far all I&amp;#39;m able to do is open the InfoPath template (.xsn) file, but I&amp;#39;m not exactly sure how I start populating data in the fields. This is the code I have so far:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim appInfoPath As InfoPath.Application&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim docInfoPath As InfoPath.XDocument&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set appInfoPath = CreateObject(&amp;quot;infopath.Application&amp;quot;) &amp;#39;Create an instance of InfoPath&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set docInfoPath = appInfoPath.XDocuments.NewFromSolution(&amp;quot;N:\Database\Compensation\Working copy\Payment_Request.xsn&amp;quot;)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;After looking at the &amp;#39;Watch&amp;#39; window in Access, I can see the fields (eg, &amp;quot;SAPDocNumber&amp;quot;)&amp;nbsp;I want to populate but as I said, not sure what code I need to use to actually do that (see image).&lt;/p&gt;
&lt;p&gt;&lt;a href="http://imageshack.us/photo/my-images/834/watchwindow.jpg"&gt;http://imageshack.us/photo/my-images/834/watchwindow.jpg&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Any help you can give would be really appreciated.&lt;/p&gt;
&lt;p&gt;Cheers&lt;/p&gt;</description></item></channel></rss>