<?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>General</title><link>https://www.infopathdev.com:443/forums/41.aspx</link><description>If you're not sure where to ask your question, ask it here. If necessary, our moderators will make sure it gets classified in the correct board.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Activating Secondary Data Connections to populate Drop down fields only when selected ?</title><link>https://www.infopathdev.com:443/forums/thread/29968.aspx</link><pubDate>Tue, 01 Jul 2008 14:55:40 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:29968</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/29968.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=29968</wfw:commentRss><description>&lt;p&gt;Hi:&lt;/p&gt;
&lt;p&gt;Your secondary data connection query can be run with a single line of code. In C#:&lt;/p&gt;
&lt;blockquote&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;
&lt;p&gt;this&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.DataConnections[&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;DataConnectionName&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;].Execute();&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;&lt;font size="2"&gt;With &amp;quot;DataConnectionName&amp;quot; replaced with the name of your data connection. However, the trouble that you will have is finding an event to connect this to. The events associated with most controls (like the dropdown) in InfoPath 2007&amp;nbsp;are Changing, Validation, and Changed. For a full description of these three events, please see: &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.office.infopath.xmlevent_events(VS.80).aspx"&gt;http://msdn.microsoft.com/en-us/library/microsoft.office.infopath.xmlevent_events(VS.80).aspx&lt;/a&gt;&amp;nbsp;. There isn&amp;#39;t an event that runs when a control is selected. &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;If you have other fields that are always filled out before a user would need the drop down, you could add the code to an event related to those fields, but that is a bit of a gamble, as you are betting the user fills out the form in a certain order... I suppose you could hide the drop down until the previous fields are filled out....&lt;/p&gt;&lt;/font&gt;</description></item><item><title>Activating Secondary Data Connections to populate Drop down fields only when selected ?</title><link>https://www.infopathdev.com:443/forums/thread/29956.aspx</link><pubDate>Tue, 01 Jul 2008 11:51:32 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:29956</guid><dc:creator>soulman</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/29956.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=29956</wfw:commentRss><description>&lt;p&gt;Hi, I am having an issue with my form taking a long time to load-up. After playing around, i can pin it down to the number of secondary data connections i have set-up to &amp;quot;Automatically Retrieve Data When Form is Opened&amp;quot;&amp;nbsp;which i need in&amp;nbsp;order to auto populate the many drop-down fields from my Access database. By the way, i know a web service would solve this problem but this is not an option.&lt;/p&gt;
&lt;p&gt;I know i can make these additional&amp;nbsp; connections as &amp;quot;non automatic retrieval&amp;quot; and create a seperate button to populate the relevant drop-down, but this is a bit messy. Ideally i would like to modify the code so that when a drop down is selected, it will retrieve the look-up data. Is this possible and what code would i need to add, bearing in mind im not really a programmer.&lt;/p&gt;
&lt;p&gt;Any help would be much appreciated.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>