<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://msmvps.com/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>Ben Walters InfoPath MVP : InfoPath 2007</title><link>http://msmvps.com/blogs/benwalters/archive/tags/InfoPath+2007/default.aspx</link><description>Tags: InfoPath 2007</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP2 (Build: 40407.4157)</generator><item><title>Create Form based on an existing Schema</title><link>http://msmvps.com/blogs/benwalters/archive/2009/04/21/create-form-based-on-an-existing-schema.aspx</link><pubDate>Tue, 21 Apr 2009 12:39:31 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1689476</guid><dc:creator>Ben Walters</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/benwalters/rsscomments.aspx?PostID=1689476</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/benwalters/commentapi.aspx?PostID=1689476</wfw:comment><comments>http://msmvps.com/blogs/benwalters/archive/2009/04/21/create-form-based-on-an-existing-schema.aspx#comments</comments><description>Ok so this is the last of my video posts for today. This video shows how you can design a new InfoPath form based of an existing schema file....(&lt;a href="http://msmvps.com/blogs/benwalters/archive/2009/04/21/create-form-based-on-an-existing-schema.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1689476" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/benwalters/archive/tags/InfoPath+2007/default.aspx">InfoPath 2007</category><category domain="http://msmvps.com/blogs/benwalters/archive/tags/Form+Services/default.aspx">Form Services</category><category domain="http://msmvps.com/blogs/benwalters/archive/tags/InfoPath+Form+Development/default.aspx">InfoPath Form Development</category><category domain="http://msmvps.com/blogs/benwalters/archive/tags/Office+2007/default.aspx">Office 2007</category></item><item><title>Accessing Active Directory from an InfoPath Form</title><link>http://msmvps.com/blogs/benwalters/archive/2009/04/21/accessing-active-directory-from-an-infopath-form.aspx</link><pubDate>Tue, 21 Apr 2009 06:44:43 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1689371</guid><dc:creator>Ben Walters</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/benwalters/rsscomments.aspx?PostID=1689371</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/benwalters/commentapi.aspx?PostID=1689371</wfw:comment><comments>http://msmvps.com/blogs/benwalters/archive/2009/04/21/accessing-active-directory-from-an-infopath-form.aspx#comments</comments><description>The embedded video below highlights how to load user details from Active Directory into your InfoPath form. The solution highlighted uses the LDAP Webservice found on codeplex to make the LDAP connection. The best thing about this approach is that the...(&lt;a href="http://msmvps.com/blogs/benwalters/archive/2009/04/21/accessing-active-directory-from-an-infopath-form.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1689371" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/benwalters/archive/tags/InfoPath+2007/default.aspx">InfoPath 2007</category><category domain="http://msmvps.com/blogs/benwalters/archive/tags/Form+Services/default.aspx">Form Services</category><category domain="http://msmvps.com/blogs/benwalters/archive/tags/InfoPath+Form+Development/default.aspx">InfoPath Form Development</category><category domain="http://msmvps.com/blogs/benwalters/archive/tags/Office+2007/default.aspx">Office 2007</category></item><item><title>How to calculate the number of days between 2 dates in InfoPath</title><link>http://msmvps.com/blogs/benwalters/archive/2009/04/21/how-to-calculate-the-number-of-days-between-2-dates-in-infopath.aspx</link><pubDate>Tue, 21 Apr 2009 05:13:27 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1689335</guid><dc:creator>Ben Walters</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/benwalters/rsscomments.aspx?PostID=1689335</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/benwalters/commentapi.aspx?PostID=1689335</wfw:comment><comments>http://msmvps.com/blogs/benwalters/archive/2009/04/21/how-to-calculate-the-number-of-days-between-2-dates-in-infopath.aspx#comments</comments><description>Recently while helping some people via the Newsgroups I’ve found it easier to build a video of how to solve a problem rather than type pages and pages of instructions. In addition to giving a big call out to Camtasia studio as an editing platform and...(&lt;a href="http://msmvps.com/blogs/benwalters/archive/2009/04/21/how-to-calculate-the-number-of-days-between-2-dates-in-infopath.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1689335" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/benwalters/archive/tags/InfoPath+2007/default.aspx">InfoPath 2007</category><category domain="http://msmvps.com/blogs/benwalters/archive/tags/InfoPath+Form+Development/default.aspx">InfoPath Form Development</category></item><item><title>Office SP2 to release next week</title><link>http://msmvps.com/blogs/benwalters/archive/2009/04/15/office-sp2-to-release-next-week.aspx</link><pubDate>Wed, 15 Apr 2009 06:11:01 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1687659</guid><dc:creator>Ben Walters</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/benwalters/rsscomments.aspx?PostID=1687659</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/benwalters/commentapi.aspx?PostID=1687659</wfw:comment><comments>http://msmvps.com/blogs/benwalters/archive/2009/04/15/office-sp2-to-release-next-week.aspx#comments</comments><description>Officially the second service pack for the Office suite will release next week, and while I’m sure there are a whole swag of features, additions and security improvements that will not be immediately visible to the naked eye. There are a couple of things...(&lt;a href="http://msmvps.com/blogs/benwalters/archive/2009/04/15/office-sp2-to-release-next-week.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1687659" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/benwalters/archive/tags/InfoPath+2007/default.aspx">InfoPath 2007</category><category domain="http://msmvps.com/blogs/benwalters/archive/tags/MOSS/default.aspx">MOSS</category><category domain="http://msmvps.com/blogs/benwalters/archive/tags/Form+Server/default.aspx">Form Server</category><category domain="http://msmvps.com/blogs/benwalters/archive/tags/Office+2007/default.aspx">Office 2007</category><category domain="http://msmvps.com/blogs/benwalters/archive/tags/Office+2007+SP2/default.aspx">Office 2007 SP2</category></item><item><title>Presenting at Office DevCon</title><link>http://msmvps.com/blogs/benwalters/archive/2008/10/20/presenting-at-office-devcon.aspx</link><pubDate>Mon, 20 Oct 2008 01:05:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1651460</guid><dc:creator>Ben Walters</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/benwalters/rsscomments.aspx?PostID=1651460</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/benwalters/commentapi.aspx?PostID=1651460</wfw:comment><comments>http://msmvps.com/blogs/benwalters/archive/2008/10/20/presenting-at-office-devcon.aspx#comments</comments><description>Looks like my first week of work at my new employer just got busy, in my first week it looks like I’ll be heading up to Sydney to present at the 2008 Office DevCon. This is a great event that I’ve wanted to get to last year but was unable to, “Office...(&lt;a href="http://msmvps.com/blogs/benwalters/archive/2008/10/20/presenting-at-office-devcon.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1651460" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/benwalters/archive/tags/InfoPath+2007/default.aspx">InfoPath 2007</category><category domain="http://msmvps.com/blogs/benwalters/archive/tags/InfoPath+Form+Development/default.aspx">InfoPath Form Development</category><category domain="http://msmvps.com/blogs/benwalters/archive/tags/Office+DevCon/default.aspx">Office DevCon</category></item><item><title>TechEd Demo Woes</title><link>http://msmvps.com/blogs/benwalters/archive/2008/09/08/teched-demo-woes.aspx</link><pubDate>Mon, 08 Sep 2008 05:04:03 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1647093</guid><dc:creator>Ben Walters</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/benwalters/rsscomments.aspx?PostID=1647093</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/benwalters/commentapi.aspx?PostID=1647093</wfw:comment><comments>http://msmvps.com/blogs/benwalters/archive/2008/09/08/teched-demo-woes.aspx#comments</comments><description>Last week Sydney was host to TechEd 2008, it also found me struggling with issues in my Windows 2008 MOSS Demo environment, the long and short of my issue was that an InfoPath form that worked quite successfully on my local machine was failing to submit...(&lt;a href="http://msmvps.com/blogs/benwalters/archive/2008/09/08/teched-demo-woes.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1647093" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/benwalters/archive/tags/InfoPath+2007/default.aspx">InfoPath 2007</category><category domain="http://msmvps.com/blogs/benwalters/archive/tags/InfoPath+Form+Development/default.aspx">InfoPath Form Development</category><category domain="http://msmvps.com/blogs/benwalters/archive/tags/TechEd+2008/default.aspx">TechEd 2008</category></item><item><title>I'm still here!</title><link>http://msmvps.com/blogs/benwalters/archive/2008/07/23/i-m-still-here.aspx</link><pubDate>Wed, 23 Jul 2008 08:37:59 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1641851</guid><dc:creator>Ben Walters</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/benwalters/rsscomments.aspx?PostID=1641851</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/benwalters/commentapi.aspx?PostID=1641851</wfw:comment><comments>http://msmvps.com/blogs/benwalters/archive/2008/07/23/i-m-still-here.aspx#comments</comments><description>Wow just had a look at my blog and it&amp;#39;s been nearly 2 months since I posted, were does the time go? First a quick catch up on what&amp;#39;s been happening over the past couple of months Been busy with preps for my new son who&amp;#39;s due in the next couple...(&lt;a href="http://msmvps.com/blogs/benwalters/archive/2008/07/23/i-m-still-here.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1641851" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/benwalters/archive/tags/InfoPath+2007/default.aspx">InfoPath 2007</category><category domain="http://msmvps.com/blogs/benwalters/archive/tags/Form+Services/default.aspx">Form Services</category><category domain="http://msmvps.com/blogs/benwalters/archive/tags/InfoPath+Form+Development/default.aspx">InfoPath Form Development</category></item><item><title>Filtered Drop Down Lists 101 Part 2</title><link>http://msmvps.com/blogs/benwalters/archive/2008/02/26/filtered-drop-down-lists-101-part-2.aspx</link><pubDate>Mon, 25 Feb 2008 23:09:31 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1147587</guid><dc:creator>Ben Walters</dc:creator><slash:comments>5</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/benwalters/rsscomments.aspx?PostID=1147587</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/benwalters/commentapi.aspx?PostID=1147587</wfw:comment><comments>http://msmvps.com/blogs/benwalters/archive/2008/02/26/filtered-drop-down-lists-101-part-2.aspx#comments</comments><description>&lt;p&gt;Now for the long awaited second half of my post on working with Filtered Drop down lists. &lt;/p&gt; &lt;p&gt;In my first post I showed you how to created filtered drop down lists using the InfoPath rich client. In this post I will show you how to achieve the same functionality in a web based form. &lt;/p&gt; &lt;p&gt;The biggest draw back about creating this functionality in a web based form is that filtered fields are not supported in web based forms. So we need to create another means to filter our data, an external data source like a web service for example provides us with this ability as all the filtering can be done using code and then returned to the InfoPath form via a data connection. &lt;/p&gt; &lt;p&gt;In my last post I used a set of data based around car manufactures and models. I&amp;#39;ll use the same data for this example. This doesn&amp;#39;t mean that only an XML file can be used to source this data there is no reason why you couldn&amp;#39;t use SQL or another database as a data store to source your data. &lt;/p&gt; &lt;p&gt;For this post I&amp;#39;m going to create a reasonably basic web service that contains 3 web methods. The first will return a list of car manufactures, the second will return a list of car models for the supplied manufacturer, and the third method will return a list of available colours for the selected Manufacturer/Model combination. &lt;/p&gt; &lt;p&gt;&lt;strong&gt;Method 1&lt;/strong&gt;&lt;/p&gt;&lt;pre class="code"&gt;&lt;span&gt;///&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;lt;summary&amp;gt;
&lt;/span&gt;    &lt;span&gt;///&lt;/span&gt;&lt;span&gt; This method returns a list of car manufacturers
&lt;/span&gt;    &lt;span&gt;///&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;lt;/summary&amp;gt;
&lt;/span&gt;    &lt;span&gt;///&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;
&lt;/span&gt;    [&lt;span&gt;WebMethod&lt;/span&gt;]
    &lt;span&gt;public&lt;/span&gt; &lt;span&gt;string&lt;/span&gt;[] GetCarManufacurer() 
    {
        &lt;span&gt;//Create an xml document to hold the list of cars
&lt;/span&gt;        &lt;span&gt;XmlDocument&lt;/span&gt; carList = &lt;span&gt;new&lt;/span&gt; &lt;span&gt;XmlDocument&lt;/span&gt;();
        
        &lt;span&gt;//Load the car list into the XmlDocumentObject
&lt;/span&gt;        carList.Load(&lt;span&gt;&amp;quot;http://localhost/FilteredDropdown/Reference%20Files/Cars.xml&amp;quot;&lt;/span&gt;);

        &lt;span&gt;//Create xmlNode list to hold a list of the manufacturers
&lt;/span&gt;        &lt;span&gt;XmlNodeList&lt;/span&gt; carMakers = carList.SelectNodes(&lt;span&gt;&amp;quot;//Cars/Car&amp;quot;&lt;/span&gt;);

        &lt;span&gt;//create a string array to retun a list of car manufacturers
&lt;/span&gt;        &lt;span&gt;string&lt;/span&gt;[] returnString = &lt;span&gt;null&lt;/span&gt;;

        &lt;span&gt;if&lt;/span&gt;(carMakers.Count &amp;gt;0 &amp;amp;&amp;amp; carMakers != &lt;span&gt;null&lt;/span&gt;)
        {
            returnString = &lt;span&gt;new&lt;/span&gt; &lt;span&gt;string&lt;/span&gt;[carMakers.Count];

            &lt;span&gt;//Create a counter interger to track where we are in the colleciton
&lt;/span&gt;            &lt;span&gt;int&lt;/span&gt; counter = 0;

            &lt;span&gt;//Take each car node in the collection and add the Make child node to the string array
&lt;/span&gt;            &lt;span&gt;foreach&lt;/span&gt; (&lt;span&gt;XmlNode&lt;/span&gt; car &lt;span&gt;in&lt;/span&gt; carMakers)
            {
                returnString[counter] = car.SelectSingleNode(&lt;span&gt;&amp;quot;Make&amp;quot;&lt;/span&gt;).InnerText;
                counter ++;
            }
        }

        &lt;span&gt;//return the string array
&lt;/span&gt;        &lt;span&gt;return&lt;/span&gt; returnString;
    }&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;&lt;strong&gt;Method 2&lt;/strong&gt;&lt;/p&gt;&lt;pre class="code"&gt; &lt;span&gt;///&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;lt;summary&amp;gt;
&lt;/span&gt;    &lt;span&gt;///&lt;/span&gt;&lt;span&gt; This method will return a list of Car Models for the provided Make or manufacturer
&lt;/span&gt;    &lt;span&gt;///&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;lt;/summary&amp;gt;
&lt;/span&gt;    &lt;span&gt;///&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;lt;param name=&amp;quot;Make&amp;quot;&amp;gt;&amp;lt;/param&amp;gt;
&lt;/span&gt;    &lt;span&gt;///&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;
&lt;/span&gt;    [&lt;span&gt;WebMethod&lt;/span&gt;]
    &lt;span&gt;public&lt;/span&gt; &lt;span&gt;string&lt;/span&gt;[] GetModelList(&lt;span&gt;string&lt;/span&gt; Make)
    {
        &lt;span&gt;//Create an xml document to hold the list of cars
&lt;/span&gt;        &lt;span&gt;XmlDocument&lt;/span&gt; carList = &lt;span&gt;new&lt;/span&gt; &lt;span&gt;XmlDocument&lt;/span&gt;();

        &lt;span&gt;//Load the car list into the XmlDocumentObject
&lt;/span&gt;        carList.Load(&lt;span&gt;&amp;quot;http://localhost/FilteredDropdown/Reference%20Files/Cars.xml&amp;quot;&lt;/span&gt;);

        &lt;span&gt;//Create xmlNode list to hold a list of the models for the supplied manufacturer
&lt;/span&gt;        &lt;span&gt;XmlNodeList&lt;/span&gt; carModels = carList.SelectNodes(&lt;span&gt;&amp;quot;//Cars/Car[Make=\&amp;quot;&amp;quot;&lt;/span&gt; + Make + &lt;span&gt;&amp;quot;\&amp;quot;]&amp;quot;&lt;/span&gt;);

        &lt;span&gt;//create a string array to retun a list of car manufacturers
&lt;/span&gt;        &lt;span&gt;string&lt;/span&gt;[] returnString = &lt;span&gt;null&lt;/span&gt;;

        &lt;span&gt;if&lt;/span&gt; (carModels.Count &amp;gt; 0 &amp;amp;&amp;amp; carModels != &lt;span&gt;null&lt;/span&gt;)
        {
            returnString = &lt;span&gt;new&lt;/span&gt; &lt;span&gt;string&lt;/span&gt;[carModels.Count];

            &lt;span&gt;//Create a counter interger to track where we are in the colleciton
&lt;/span&gt;            &lt;span&gt;int&lt;/span&gt; counter = 0;

            &lt;span&gt;//Take each car node in the collection and add the Make child node to the string array
&lt;/span&gt;            &lt;span&gt;foreach&lt;/span&gt; (&lt;span&gt;XmlNode&lt;/span&gt; car &lt;span&gt;in&lt;/span&gt; carModels)
            {
                returnString[counter] = car.SelectSingleNode(&lt;span&gt;&amp;quot;Model&amp;quot;&lt;/span&gt;).InnerText;
                counter++;
            }
        }

        &lt;span&gt;//return the string array
&lt;/span&gt;        &lt;span&gt;return&lt;/span&gt; returnString;
    }&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;&lt;/p&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;&lt;strong&gt;Method 3&lt;/strong&gt;&lt;/p&gt;&lt;pre class="code"&gt; &lt;span&gt;///&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;lt;summary&amp;gt;
&lt;/span&gt;    &lt;span&gt;///&lt;/span&gt;&lt;span&gt; This method will return a list of available colorus for the provided model/Make combination
&lt;/span&gt;    &lt;span&gt;///&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;lt;/summary&amp;gt;
&lt;/span&gt;    &lt;span&gt;///&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;lt;param name=&amp;quot;Model&amp;quot;&amp;gt;&amp;lt;/param&amp;gt;
&lt;/span&gt;    &lt;span&gt;///&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;
&lt;/span&gt;    [&lt;span&gt;WebMethod&lt;/span&gt;]
    &lt;span&gt;public&lt;/span&gt; &lt;span&gt;string&lt;/span&gt;[] GetAvailableColors(&lt;span&gt;string&lt;/span&gt; Model, &lt;span&gt;string&lt;/span&gt; Make)
    {
        &lt;span&gt;//Create an xml document to hold the list of cars
&lt;/span&gt;        &lt;span&gt;XmlDocument&lt;/span&gt; carList = &lt;span&gt;new&lt;/span&gt; &lt;span&gt;XmlDocument&lt;/span&gt;();

        &lt;span&gt;//Load the car list into the XmlDocumentObject
&lt;/span&gt;        carList.Load(&lt;span&gt;&amp;quot;http://localhost/FilteredDropdown/Reference%20Files/Cars.xml&amp;quot;&lt;/span&gt;);

        &lt;span&gt;//Create xmlNode list to hold a list of the models for the supplied manufacturer
&lt;/span&gt;        &lt;span&gt;XmlNodeList&lt;/span&gt; carColors = carList.SelectNodes(&lt;span&gt;&amp;quot;//Cars/Car[Model=\&amp;quot;&amp;quot;&lt;/span&gt; + Model + &lt;span&gt;&amp;quot;\&amp;quot; and Make= \&amp;quot;&amp;quot;&lt;/span&gt; + Make + &lt;span&gt;&amp;quot;\&amp;quot;]&amp;quot;&lt;/span&gt;);

        &lt;span&gt;//create a string array to retun a list of car manufacturers
&lt;/span&gt;        &lt;span&gt;string&lt;/span&gt;[] returnString = &lt;span&gt;null&lt;/span&gt;;

        &lt;span&gt;if&lt;/span&gt; (carColors.Count &amp;gt; 0 &amp;amp;&amp;amp; carColors != &lt;span&gt;null&lt;/span&gt;)
        {
            returnString = &lt;span&gt;new&lt;/span&gt; &lt;span&gt;string&lt;/span&gt;[carColors.Count];

            &lt;span&gt;//Create a counter interger to track where we are in the colleciton
&lt;/span&gt;            &lt;span&gt;int&lt;/span&gt; counter = 0;

            &lt;span&gt;//Take each car node in the collection and add the Make child node to the string array
&lt;/span&gt;            &lt;span&gt;foreach&lt;/span&gt; (&lt;span&gt;XmlNode&lt;/span&gt; car &lt;span&gt;in&lt;/span&gt; carColors)
            {
                returnString[counter] = car.SelectSingleNode(&lt;span&gt;&amp;quot;Color&amp;quot;&lt;/span&gt;).InnerText;
                counter++;
            }
        }

        &lt;span&gt;//return the string array
&lt;/span&gt;        &lt;span&gt;return&lt;/span&gt; returnString;
    }&lt;/pre&gt;
&lt;p&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;With the web service out of the way we now need to setup our InfoPath form to use it. First we&amp;#39;ll design a new blank form in InfoPath, making sure the &amp;quot;Enable browser compatible features only&amp;quot; option is checked. &lt;/p&gt;
&lt;p&gt;&lt;a href="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_E07D/image_2.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="298" alt="image" src="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_E07D/image_thumb.png" width="491" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;With our blank form created we now need to define our data structure like the one below, you&amp;#39;ll notice that I have plural duplicates of the same node so I have a Make node and a Makes node, the plural node will be used to store the items returned from the web service. This allows for different entries in the &amp;quot;Cars&amp;quot; repeating list to have different items in their drop down lists. &lt;/p&gt;
&lt;p&gt;&lt;a href="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_E3DA/image_2.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="213" alt="image" src="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_E3DA/image_thumb.png" width="185" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Now remember anything that has a plural name should have the repeating box ticked&lt;/p&gt;
&lt;p&gt;Next we&amp;#39;ll lay out our controls on the form right click on the &amp;quot;Cars&amp;quot; group and select &amp;quot;Repeating Table&amp;quot; you should end up with a table that looks like this&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_E3DA/image_4.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="153" alt="image" src="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_E3DA/image_thumb_1.png" width="515" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Now this is pretty ugly and to be honest we don&amp;#39;t need the &amp;quot;List&amp;quot; columns so removed those columns and change each of the remaining text boxes to drop down lists. &lt;/p&gt;
&lt;p&gt;You should have a table should look like this&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_E3DA/image_8.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="84" alt="image" src="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_E3DA/image_thumb_3.png" width="523" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;With our form setup we now need to hook up our web service to return the data we need for this we&amp;#39;ll need a couple of Data Connections.&lt;/p&gt;
&lt;p&gt;From the &amp;quot;Tools&amp;quot; menu select &amp;quot;Data Connections&amp;quot; this will display the &amp;quot;Data Connections&amp;quot; window&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_E07D/image_8.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="364" alt="image" src="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_E07D/image_thumb_3.png" width="236" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&lt;a href="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_E07D/image_10.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="403" alt="image" src="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_E07D/image_thumb_4.png" width="408" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Click the Add button to start the &amp;quot;Data Connection&amp;quot; wizard, for our first connection we want to retrieve a list of Car Manufacturers so select the Create New Connection to Receive data radio button. Then click the next button&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_E07D/image_12.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="341" alt="image" src="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_E07D/image_thumb_5.png" width="507" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Now we want to pull the data from the web service we created earlier so select the Web Service radio button the click next&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_E07D/image_14.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="341" alt="image" src="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_E07D/image_thumb_6.png" width="506" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Enter the name url of your web service then click Next&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_E07D/image_16.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="343" alt="image" src="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_E07D/image_thumb_7.png" width="509" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;InfoPath will then attempt to interrogate the WSDL for the web to determine the methods available. This will then present you with a list of available web methods to use, as we want to get a list of car Manufacturers we&amp;#39;ll select GetCarManufacturer then click Next&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_E07D/image_18.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="346" alt="image" src="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_E07D/image_thumb_8.png" width="513" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;For this example we are not going to store a copy of the InfoPath data with the form as it may change, but you may in your implementation prefer to store the data with the form to reduce trips to the server. For now simply click next to continue to the next step.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_E07D/image_20.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="340" alt="image" src="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_E07D/image_thumb_9.png" width="505" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;In the final step we can set when the data connection is queried and the name of the connection. This step however is usually overlooked and hence becomes a source of performance issues latter on. Be sure to check to see if you really need the data loaded automatically, as this can increase the load time of the form especially if there are multiple connections that need to be queried. For now we&amp;#39;ll accept the defaults and click the finish button as we want this data to be returned each time the form is loaded. Click close to close the &amp;quot;Data Connections&amp;quot; window&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_E07D/image_22.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="342" alt="image" src="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_E07D/image_thumb_10.png" width="508" border="0" /&gt;&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;With our first data connection created we can now hook up our first drop down list to the GetCarManufacturer method. Right click on the &amp;quot;Make&amp;quot; drop down list and select &amp;quot;Drop Down List Box Properties&amp;quot;. This will display the properties window for the drop down list box.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_E07D/image_24.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="244" alt="image" src="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_E07D/image_thumb_11.png" width="195" border="0" /&gt;&lt;/a&gt;&amp;nbsp;&lt;a href="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_E07D/image_26.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="399" alt="image" src="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_E07D/image_thumb_12.png" width="294" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;First thing we need to do is rename the field to be something a little more intuitive. So change the Field name to &amp;quot;Make&amp;quot; to match our title in the designer.&lt;/p&gt;
&lt;p&gt;Next we need to make the drop down list source its data from the data connection we created earlier. So from the &amp;quot;List Box Entries&amp;quot; section select the &amp;quot;Look up values from an external data source&amp;quot; radio button. By default InfoPath will select the first available data connection as we only have one available this is the one we want to use. With our data connection selected we now need to select the field that is going to be used in the drop down. Click on the &amp;quot;Edit Xpath&amp;quot; button next to the entries text box.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_E07D/image_28.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="484" alt="image" src="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_E07D/image_thumb_13.png" width="357" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;This will open the select field or group dialog, from here we can select the returned string array as the source for our drop down list. Then click &amp;quot;OK&amp;quot; to close the &amp;quot;Select a Field or Group&amp;quot; dialog.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_E07D/image_30.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="409" alt="image" src="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_E07D/image_thumb_14.png" width="358" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;On the properties dialog make sure the&amp;quot;Show only entries with unique name&amp;quot; check box is ticked the click ok to close the properties dialog.&lt;/p&gt;
&lt;p&gt;With the &amp;quot;Make&amp;quot; drop down list setup we now need to add some code behind the &amp;quot;Changed&amp;quot; this code will execute the second data connection &amp;quot;GetModelList&amp;quot;lets move on to the &amp;quot;Model&amp;quot; drop down. First we need to create a new Data connection to return a list of car model. Open the Data Connections dialog via the tools menu, and click the &amp;quot;Add&amp;quot; button to to start the Data Connection wizard.&lt;/p&gt;
&lt;p&gt;Create a new connection to receive data &lt;/p&gt;
&lt;p&gt;&lt;a href="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_BAE0/image_2.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="364" alt="image" src="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_BAE0/image_thumb.png" width="541" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Select &amp;quot;Web Service&amp;quot; as the data source&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_BAE0/image_4.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="367" alt="image" src="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_BAE0/image_thumb_1.png" width="545" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Enter the address of the web service we used earlier and click next&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_BAE0/image_6.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="368" alt="image" src="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_BAE0/image_thumb_2.png" width="547" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Select the &amp;quot;GetModelList&amp;quot; web method then click next&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_BAE0/image_8.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="371" alt="image" src="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_BAE0/image_thumb_3.png" width="550" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;On the next screen we need to provide a sample value for InfoPath to query the web method we have selected. This allows InfoPath to determine the XML that will be returned from the web service ahead of time. Which in turn allows us to map our drop down to the returned results. For this example click on the set value button enter &amp;quot;Ford&amp;quot; then click ok. Finally click next to move to the next step.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_BAE0/image_12.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="376" alt="image" src="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_BAE0/image_thumb_5.png" width="559" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;As this data will change each time we use the form there is no need to store the data with the form so click next to progress past this screen&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_BAE0/image_14.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="375" alt="image" src="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_BAE0/image_thumb_6.png" width="555" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Lastly we don&amp;#39;t want this data source to be queried when the form is loaded as we will not have a valid parameter to pass to it so clear the &amp;quot;Automatically retrieve data when form is opened&amp;quot; Check box and click &amp;quot;Finish&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_BAE0/image_16.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="374" alt="image" src="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_BAE0/image_thumb_7.png" width="555" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Now we have our second data connection to return our Model data setup we need to add a rule to our Make drop down to copy the selected Make into the GetModelList connection and run the query when. Open the properties for the Make drop down list and click on the &amp;quot;Rules...&amp;quot; button&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_BAE0/image_18.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="555" alt="image" src="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_BAE0/image_thumb_8.png" width="414" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Click on the &amp;quot;Add...&amp;quot; button to add a new rule to the list&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_BAE0/image_20.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="236" alt="image" src="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_BAE0/image_thumb_9.png" width="454" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Name the rule &amp;quot;Get Model List&amp;quot; then click on the &amp;quot;Set Condition...&amp;quot; button&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_BAE0/image_22.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="330" alt="image" src="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_BAE0/image_thumb_10.png" width="425" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Basically we only want this rule to run when the &amp;quot;Make&amp;quot; drop down is not blank so select &amp;quot;Is not blank&amp;quot; from the second drop down then click ok &lt;/p&gt;
&lt;p&gt;&lt;a href="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_BAE0/image_24.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="237" alt="image" src="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_BAE0/image_thumb_11.png" width="508" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Add a new action to set a fields value, as we need to pass in the selected make to the web service before it can be queried &lt;/p&gt;
&lt;p&gt;&lt;a href="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_BAE0/image_30.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="278" alt="image" src="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_BAE0/image_thumb_14.png" width="351" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Now the field we want to set is the query parameter of the GetModelList connection we made earlier so click on the &amp;quot;Select Field&amp;quot; button next to the field text box to select the appropriate field.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_BAE0/image_32.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="406" alt="image" src="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_BAE0/image_thumb_15.png" width="352" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Click ok to close the &amp;quot;Select a Field or Group&amp;quot; window and return to the action window. Click on the &lt;em&gt;FX&lt;/em&gt; button next to the &amp;quot;Value&amp;quot; text box to set the value that will be provided to the web service. Then enter a full stop in the &amp;quot;Insert Formula&amp;quot; window (A full stop is XPath shorthand and represents the current node) then click ok to close the &amp;quot;Insert Formula&amp;quot; window&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_BAE0/image_34.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="291" alt="image" src="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_BAE0/image_thumb_16.png" width="445" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Click ok once more to close the &amp;quot;Action&amp;quot; window we should now have an &amp;quot;Rule&amp;quot; window with one action listed&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_BAE0/image_36.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="355" alt="image" src="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_BAE0/image_thumb_17.png" width="462" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Click the &amp;quot;Add Action...&amp;quot;button once more to add another action, now that we have set the value to be passed in we can now execute the data connection to get a list of returned results.&lt;/p&gt;
&lt;p&gt;Select &amp;quot;Query Using Data Connection&amp;quot; from the action drop down then select &amp;quot;GetModelList&amp;quot; from the Data connection drop down and click ok.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_BAE0/image_38.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="337" alt="image" src="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_BAE0/image_thumb_18.png" width="434" border="0" /&gt;&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You should now have a rule that looks similar to the following&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_BAE0/image_40.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="333" alt="image" src="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_BAE0/image_thumb_19.png" width="435" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Click ok to save the changes&lt;/p&gt;
&lt;p&gt;Now that the the filtered data has been queried we need to store it in the form, we need to do this so we don&amp;#39;t get data inconsistencies when we add a new row to the repeating section.&lt;/p&gt;
&lt;p&gt;First right click on the GetMake Drop down and select Programming&amp;gt;Changed&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_E3DA/image_6.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="332" alt="image" src="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_E3DA/image_thumb_2.png" width="484" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;This will add a new event handler to the code that will execute after the value has been changed and also after any rules have been processed. So by the time this code executes the new values would have been selected and the GetModelList data connection should have been run. What the code now needs to do is to fill the ModelList/Models nodes with the models that were returned from the web service. &lt;/p&gt;
&lt;p&gt;Model Population code&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color:green;"&gt;//If no models were returned then don&amp;#39;t attmept to fill the list
&lt;/span&gt;&lt;span style="color:blue;"&gt;if &lt;/span&gt;(getModels.SelectSingleNode(&lt;span style="color:#a31515;"&gt;&amp;quot;/dfs:myFields/dfs:dataFields/tns:GetModelListResponse/tns:GetModelListResult/tns:string&amp;quot;&lt;/span&gt;, &lt;span style="color:blue;"&gt;this&lt;/span&gt;.NamespaceManager) != &lt;span style="color:blue;"&gt;null&lt;/span&gt;) 
{
    &lt;span style="color:green;"&gt;//Check for any existing entries that may have been carried over from the previous row
    &lt;/span&gt;&lt;span style="color:blue;"&gt;if &lt;/span&gt;(currentRow.Select(&lt;span style="color:#a31515;"&gt;&amp;quot;../my:ModelList/my:Models&amp;quot;&lt;/span&gt;,&lt;span style="color:blue;"&gt;this&lt;/span&gt;.NamespaceManager).Count &amp;gt; 1)
    {
        currentRow.SelectSingleNode(&lt;span style="color:#a31515;"&gt;&amp;quot;../my:ModelList/my:Models[2]&amp;quot;&lt;/span&gt;, &lt;span style="color:blue;"&gt;this&lt;/span&gt;.NamespaceManager).DeleteRange(currentRow.SelectSingleNode(&lt;span style="color:#a31515;"&gt;&amp;quot;../my:ModelList/my:Models[last()]&amp;quot;&lt;/span&gt;, &lt;span style="color:blue;"&gt;this&lt;/span&gt;.NamespaceManager));
        currentRow.SelectSingleNode(&lt;span style="color:#a31515;"&gt;&amp;quot;../my:ModelList/my:Models[1]&amp;quot;&lt;/span&gt;, &lt;span style="color:blue;"&gt;this&lt;/span&gt;.NamespaceManager).SetValue(&lt;span style="color:#a31515;"&gt;&amp;quot;&amp;quot;&lt;/span&gt;);
    }

    &lt;span style="color:green;"&gt;//Loop through each of the models returned and add them to the ModelList/Models node
    &lt;/span&gt;&lt;span style="color:blue;"&gt;foreach &lt;/span&gt;(&lt;span style="color:#2b91af;"&gt;XPathNavigator &lt;/span&gt;model &lt;span style="color:blue;"&gt;in &lt;/span&gt;getModels.Select(&lt;span style="color:#a31515;"&gt;&amp;quot;/dfs:myFields/dfs:dataFields/tns:GetModelListResponse/tns:GetModelListResult/tns:string&amp;quot;&lt;/span&gt;, &lt;span style="color:blue;"&gt;this&lt;/span&gt;.NamespaceManager))
    {
        &lt;span style="color:green;"&gt;//If the first node hasn&amp;#39;t been set then set it with the first model returned
        &lt;/span&gt;&lt;span style="color:blue;"&gt;if &lt;/span&gt;(currentRow.SelectSingleNode(&lt;span style="color:#a31515;"&gt;&amp;quot;../my:ModelList/my:Models&amp;quot;&lt;/span&gt;, &lt;span style="color:blue;"&gt;this&lt;/span&gt;.NamespaceManager).Value == &lt;span style="color:blue;"&gt;string&lt;/span&gt;.Empty)
        {
            currentRow.SelectSingleNode(&lt;span style="color:#a31515;"&gt;&amp;quot;../my:ModelList/my:Models&amp;quot;&lt;/span&gt;, &lt;span style="color:blue;"&gt;this&lt;/span&gt;.NamespaceManager).InnerXml = model.InnerXml;
        }
        &lt;span style="color:blue;"&gt;else &lt;/span&gt;&lt;span style="color:green;"&gt;//clone the last node in the list update it&amp;#39;s value then insert the updated node at the end of the list
        &lt;/span&gt;{
            &lt;span style="color:#2b91af;"&gt;XPathNavigator &lt;/span&gt;newModel = currentRow.SelectSingleNode(&lt;span style="color:#a31515;"&gt;&amp;quot;../my:ModelList/my:Models[last()]&amp;quot;&lt;/span&gt;, &lt;span style="color:blue;"&gt;this&lt;/span&gt;.NamespaceManager).Clone();
            newModel.InnerXml = model.InnerXml;
            currentRow.SelectSingleNode(&lt;span style="color:#a31515;"&gt;&amp;quot;../my:ModelList/my:Models[last()]&amp;quot;&lt;/span&gt;, &lt;span style="color:blue;"&gt;this&lt;/span&gt;.NamespaceManager).InsertAfter(newModel);
        }
    }
}&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;Now that the models are being populated we can hook up the datasource for our Models Drop down list, switch back to the form designer and right click the models drop down and select properties&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_E3DA/image_10.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="305" alt="image" src="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_E3DA/image_thumb_4.png" width="304" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Select the &amp;quot;Look up values in the forms data source&amp;quot; option then for the entries value select the &amp;quot;Models&amp;quot; repeating node under the &amp;quot;ModelsList&amp;quot; group&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_E3DA/image_12.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="508" alt="image" src="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_E3DA/image_thumb_5.png" width="374" border="0" /&gt;&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Make sure you check the &amp;quot;Show Only entries with unique display names&amp;quot; then click ok to save your changes&lt;/p&gt;
&lt;p&gt;Now run your form to test your changes, you should find that when you select a make the model list automatically becomes populated with the data from the web service, plus because we are storing the returned data in the form if a new row is added the returned data is duplicated from row to row&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_E3DA/image_18.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="152" alt="image" src="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_E3DA/image_thumb_8.png" width="404" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&lt;a href="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_E3DA/image_20.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="104" alt="image" src="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_E3DA/image_thumb_9.png" width="404" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_E3DA/image_22.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="139" alt="image" src="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_E3DA/image_thumb_10.png" width="404" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_E3DA/image_24.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="167" alt="image" src="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101Part2_E3DA/image_thumb_11.png" width="404" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Now I&amp;#39;ve left the code for setting the colour up out on purpose consider it a little challenge to make sure you can understand the concepts. &lt;/p&gt;
&lt;p&gt;However I&amp;#39;m not completely heartless, if you want the complete solution you can always download it from here &lt;/p&gt;
&lt;p&gt;&lt;iframe style="border-right:#dde5e9 1px solid;padding-right:0px;border-top:#dde5e9 1px solid;padding-left:0px;padding-bottom:0px;margin:3px;border-left:#dde5e9 1px solid;width:240px;padding-top:0px;border-bottom:#dde5e9 1px solid;height:66px;background-color:#ffffff;" src="http://cid-827e505b68b939ee.skydrive.live.com/embedrowdetail.aspx/Public/FilteredDropDownListSample" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;you should note however this solution was created in Visual Studio 2008 so you may have to play around to get it running Visual Studio 2005, if I get time I&amp;#39;ll put up a second copy for everyone stuck on old tech :o)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Update: &lt;/em&gt;Thank you all for your comments, I&amp;#39;ve updated the code sample that was loaded to skydrive the InfoPath project is now included go forth and download :o)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1147587" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/benwalters/archive/tags/InfoPath+2007/default.aspx">InfoPath 2007</category><category domain="http://msmvps.com/blogs/benwalters/archive/tags/Form+Services/default.aspx">Form Services</category><category domain="http://msmvps.com/blogs/benwalters/archive/tags/InfoPath+Form+Development/default.aspx">InfoPath Form Development</category></item><item><title>Filtered Drop Down Lists 101</title><link>http://msmvps.com/blogs/benwalters/archive/2007/08/05/filtered-drop-down-lists-101.aspx</link><pubDate>Sun, 05 Aug 2007 08:20:21 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1036311</guid><dc:creator>Ben Walters</dc:creator><slash:comments>19</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/benwalters/rsscomments.aspx?PostID=1036311</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/benwalters/commentapi.aspx?PostID=1036311</wfw:comment><comments>http://msmvps.com/blogs/benwalters/archive/2007/08/05/filtered-drop-down-lists-101.aspx#comments</comments><description>&lt;p&gt;A couple of weeks ago I received an email from Dominic asking for help with creating filtered drop down lists in InfoPath. So I thought I would put together a couple of posts on how to achieve this functionality in both InfoPath 2003 and InfoPath 2007.&lt;/p&gt; &lt;p&gt;For this post I&amp;#39;m going to look at how to filter drop down data while using the InfoPath client, as filtering of data is not supported in browser based forms I will cover this in a separate post.&lt;/p&gt; &lt;p&gt;The first thing we are going to need is some data to filter,&amp;nbsp;at the end of this post&amp;nbsp;is a list of cars with their makes and models that I have used for this example. Simply take the data listed below and paste it into a new XML file called CarList.xml&lt;/p&gt; &lt;p&gt;So with our data taken care of it&amp;#39;s time to create our form. Now for these examples I&amp;#39;m going to be using InfoPath 2007 however the same principals ring true when filtering data in InfoPath 2003. Open InfoPath and design a new form, match the data source to the one displayed below (note: the data type for each of the fields is simply text)&lt;/p&gt; &lt;p&gt;&lt;a href="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101_1305E/image.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="132" alt="image" src="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101_1305E/image_thumb.png" width="201" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;With the car repeating section created right click on the car group and select &amp;quot;Repeating table&amp;quot; to add a new repeating table to the form design.&lt;/p&gt; &lt;p&gt;&lt;a href="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101_1305E/image_1.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="207" alt="image" src="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101_1305E/image_thumb_1.png" width="447" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Right click on the Make, Model, and Color text boxes and change them to Drop Down Lists&lt;/p&gt; &lt;p&gt;&lt;a href="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101_13230/image_7.png"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="476" alt="image" src="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101_13230/image_thumb_7.png" width="424" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;You should now have a form that looks like this&lt;/p&gt; &lt;p&gt;&lt;a href="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101_1305E/image_3.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="68" alt="image" src="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101_1305E/image_thumb_3.png" width="610" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;With our three drop down lists created we now need to fill them with data, open the properties dialog for the Make drop down list and select the &amp;quot;Look up values from an external data source&amp;quot; option.&lt;/p&gt; &lt;p&gt;Click on the Add button to create a new external data connection, &lt;/p&gt; &lt;ul&gt; &lt;li&gt;Select Receive Data Connection Click next  &lt;li&gt;Select XML document then click next  &lt;li&gt;Navigate to the XML Document you created using the Car Data below then click next  &lt;li&gt;The select &amp;quot;Include the data as a resource file in the form template or template part option&amp;quot; then click next  &lt;li&gt;Name your data source &amp;quot;CarList&amp;quot;, Make sure the &amp;quot;Automatically retrieve data when the form is loaded is check then click Finish&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;You should now have a properties dialog that looks similar to the following&lt;/p&gt; &lt;p&gt;&lt;a href="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101_1305E/image_4.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="510" alt="image" src="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101_1305E/image_thumb_4.png" width="384" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Click on the button next to the Entries: text box to select the data you want displayed in the drop down you will be presented with the field selector dialog, as we don&amp;#39;t need to filter any of the Make data you can select the make node and then click ok&lt;/p&gt; &lt;p&gt;&lt;a href="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101_1305E/image_5.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="358" alt="image" src="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101_1305E/image_thumb_5.png" width="313" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Make sure the show only entries with unique display names is checked (note: this&amp;nbsp;feature is only available in InfoPath 2007, this means that you will need to structure your data slightly differently for an InfoPath 2003 form) then click the OK button to close the properties dialog for the &amp;quot;Make&amp;quot; drop down.&lt;/p&gt; &lt;p&gt;now comes the fun part setting up the filtered drop down lists, open the properties dialog for the &amp;quot;Model&amp;quot; drop down, and select the option to source data from an external data source (you will be able to use the existing connection to the CarList.xml file that we made earlier)&lt;/p&gt; &lt;p&gt;Click on the entries button to select the data to be displayed and select the Model field, before clicking ok click on the &amp;quot;Filter Data&amp;quot; button.&lt;/p&gt; &lt;p&gt;&lt;a href="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101_13230/image.png"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="356" alt="image" src="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101_13230/image_thumb.png" width="305" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&lt;a href="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101_13230/image_1.png"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="214" alt="image" src="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101_13230/image_thumb_1.png" width="401" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Click the &amp;quot;Add&amp;quot; button to create a new data filter.&lt;/p&gt; &lt;p&gt;&lt;a href="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101_13230/image_2.png"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="159" alt="image" src="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101_13230/image_thumb_2.png" width="553" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Creating the filter is pretty straight forward, the first Drop Down represents the field that you are comparing, this case it is the &amp;quot;Make&amp;quot; node from our CarList.xml file. The second drop down represents the equation type that will be used Equal to, Not Equal to etc... The third and final drop down represents the&amp;nbsp;field you want to compare to, in this example it&amp;#39;s the &amp;quot;Make&amp;quot; field in our forms data source. When you click on the &amp;quot;Select a field or group...&amp;quot; option you will be able to select the &amp;quot;Make&amp;quot; field from the main data source.&lt;/p&gt; &lt;p&gt;&lt;a href="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101_13230/image_3.png"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="397" alt="image" src="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101_13230/image_thumb_3.png" width="340" border="0" /&gt;&lt;/a&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Click ok to close the &amp;quot;Select a Field or Group&amp;quot; dialog, and click OK on each of the remaining open dialogs to close them and commit their changes. &lt;/p&gt; &lt;p&gt;Now if we click on the preview button on our form we should see the filtered drop downs working.&amp;nbsp; &lt;a href="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101_13230/image_4.png"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="106" alt="image" src="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101_13230/image_thumb_4.png" width="641" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&lt;a href="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101_13230/image_5.png"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="105" alt="image" src="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101_13230/image_thumb_5.png" width="646" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;The added bonus is that because our filtering is based on the current item it works just as effectively in a repeating list.&lt;/p&gt; &lt;p&gt;&lt;a href="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101_13230/image_6.png"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="168" alt="image" src="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/FilteredDropDownLists101_13230/image_thumb_6.png" width="652" border="0" /&gt;&lt;/a&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;For now this is where I leave you, you&amp;#39;ll notice however that there is one more drop down in the form that has not been setup, I figured I would leave the Colour drop down for you to setup. Basically all you have to do is filter the Colour drop down data based on the selection in the Model drop down. Next time I&amp;#39;ll show you how to achieve the same functionality in a web based form &lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;u&gt;Car list XML Sample&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&amp;lt;CarList&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;Cars&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Car&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Make&amp;gt;Ford&amp;lt;/Make&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Model&amp;gt;XR6&amp;lt;/Model&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Color&amp;gt;Blue&amp;lt;/Color&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Car&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Car&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Make&amp;gt;Ford&amp;lt;/Make&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Model&amp;gt;XR6&amp;lt;/Model&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Color&amp;gt;Red&amp;lt;/Color&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Car&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Car&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Make&amp;gt;Ford&amp;lt;/Make&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Model&amp;gt;XR6&amp;lt;/Model&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Color&amp;gt;Yellow&amp;lt;/Color&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Car&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Car&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Make&amp;gt;Holden&amp;lt;/Make&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Model&amp;gt;Commodore&amp;lt;/Model&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Color&amp;gt;Green&amp;lt;/Color&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Car&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Car&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Make&amp;gt;Holden&amp;lt;/Make&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Model&amp;gt;Commodore&amp;lt;/Model&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Color&amp;gt;Orange&amp;lt;/Color&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Car&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Car&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Make&amp;gt;Holden&amp;lt;/Make&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Model&amp;gt;Commodore&amp;lt;/Model&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Color&amp;gt;Aqua&amp;lt;/Color&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Car&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Car&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Make&amp;gt;Ford&amp;lt;/Make&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Model&amp;gt;Focus&amp;lt;/Model&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Color&amp;gt;Black&amp;lt;/Color&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Car&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Car&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Make&amp;gt;Ford&amp;lt;/Make&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Model&amp;gt;Focus&amp;lt;/Model&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Color&amp;gt;Light Blue&amp;lt;/Color&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Car&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Car&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Make&amp;gt;Ford&amp;lt;/Make&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Model&amp;gt;Focus&amp;lt;/Model&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Color&amp;gt;White&amp;lt;/Color&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Car&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Car&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Make&amp;gt;Holden&amp;lt;/Make&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Model&amp;gt;Astra&amp;lt;/Model&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Color&amp;gt;Pink&amp;lt;/Color&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Car&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Car&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Make&amp;gt;Holden&amp;lt;/Make&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Model&amp;gt;Astra&amp;lt;/Model&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Color&amp;gt;Cornflower Blue&amp;lt;/Color&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Car&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Car&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Make&amp;gt;Toyota&amp;lt;/Make&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Model&amp;gt;Camry&amp;lt;/Model&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Color&amp;gt;White&amp;lt;/Color&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Car&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Car&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Make&amp;gt;Toyota&amp;lt;/Make&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Model&amp;gt;Camry&amp;lt;/Model&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Color&amp;gt;Gold&amp;lt;/Color&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Car&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Car&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Make&amp;gt;Toyota&amp;lt;/Make&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Model&amp;gt;Camry&amp;lt;/Model&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Color&amp;gt;Red&amp;lt;/Color&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Car&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Car&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Make&amp;gt;Porsche&amp;lt;/Make&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Model&amp;gt;Boxter&amp;lt;/Model&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Color&amp;gt;Red&amp;lt;/Color&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Car&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Car&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Make&amp;gt;Porsche&amp;lt;/Make&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Model&amp;gt;Boxter&amp;lt;/Model&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Color&amp;gt;Blue&amp;lt;/Color&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Car&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Car&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Make&amp;gt;Porsche&amp;lt;/Make&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Model&amp;gt;Boxter&amp;lt;/Model&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Color&amp;gt;Black&amp;lt;/Color&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Car&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Car&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Make&amp;gt;Porsche&amp;lt;/Make&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Model&amp;gt;Carrera&amp;lt;/Model&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Color&amp;gt;White&amp;lt;/Color&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Car&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Car&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Make&amp;gt;Porsche&amp;lt;/Make&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Model&amp;gt;Carrera&amp;lt;/Model&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Color&amp;gt;Yellow&amp;lt;/Color&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Car&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;/Cars&amp;gt;&lt;br /&gt;&amp;lt;/CarList&amp;gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1036311" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/benwalters/archive/tags/InfoPath+2007/default.aspx">InfoPath 2007</category><category domain="http://msmvps.com/blogs/benwalters/archive/tags/InfoPath+Form+Development/default.aspx">InfoPath Form Development</category></item><item><title>Contact Selector the Good and the Bad</title><link>http://msmvps.com/blogs/benwalters/archive/2007/07/13/contact-selector-the-good-and-the-bad.aspx</link><pubDate>Fri, 13 Jul 2007 11:39:51 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1019244</guid><dc:creator>Ben Walters</dc:creator><slash:comments>8</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/benwalters/rsscomments.aspx?PostID=1019244</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/benwalters/commentapi.aspx?PostID=1019244</wfw:comment><comments>http://msmvps.com/blogs/benwalters/archive/2007/07/13/contact-selector-the-good-and-the-bad.aspx#comments</comments><description>&lt;p dir="ltr" style="margin-right:0px;"&gt;This week I was working on an InfoPath solution that required&amp;nbsp;the use of the Contact Selector Control that is included with InfoPath, basically this is an Active X control that you can use as a way of selecting accounts that exist on your SharePoint server (for more info on the control and how to set it up check out&amp;nbsp;this post from the &lt;a href="http://blogs.msdn.com/infopath/archive/2007/02/28/using-the-contact-selector-control.aspx" target="_blank"&gt;InfoPath team blog&lt;/a&gt;)&amp;nbsp;Now there is a standing rule that Active X controls don&amp;#39;t work in form services however this control is the exception to that rule and can be used in a browser enabled form. This being said there are some pit falls to keep in mind when using this control with managed code in a browser based deployment as you&amp;#39;ll see below.&lt;/p&gt; &lt;p&gt;While I didn&amp;#39;t have any&amp;nbsp;trouble getting the control working I did have&amp;nbsp;a requirement where by I needed to&amp;nbsp;limit the number of contacts selected to 1. Now on the post noted above it is recommended to use the following code on the Validating event of the controls container group to add an error to the forms error collection hence preventing the user from submitting the form before continuing.&lt;/p&gt; &lt;p&gt;if (e.Operation == XmlOperation.Insert)&lt;/p&gt; &lt;p&gt;{&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt; &lt;p&gt;if (e.Site.SelectChildren(XPathNodeType.Element).Count &amp;gt; 1)&lt;/p&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;blockquote&gt; &lt;p&gt;{&lt;/p&gt;&lt;/blockquote&gt; &lt;blockquote&gt; &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; e.ReportError(e.Site, false, Message, &amp;quot;Only 1 user can be selected!&amp;quot;);&lt;/p&gt;&lt;/blockquote&gt; &lt;blockquote&gt; &lt;p&gt;}&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;}&lt;/p&gt; &lt;p&gt;This code worked great in the client version of the form however when I ran the browser version of the form, I found that this code would not run reliably. &lt;/p&gt; &lt;p&gt;If I entered 2 surnames to validate lets say &amp;quot;Smith&amp;quot; and &amp;quot;Jones&amp;quot; then clicked the validate button&lt;a href="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/ContactSelectortheGoodandtheBad_14FA0/image_1.png"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" alt="image" src="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/ContactSelectortheGoodandtheBad_14FA0/image_thumb_1.png" border="0" /&gt;&lt;/a&gt;&amp;nbsp; the names would be resolved from the server and the control would be updated accordingly. However it seemed that the validation code had not run as there was no error being displayed. If I clicked the validate button &lt;a href="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/ContactSelectortheGoodandtheBad_14FA0/image_2.png"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" alt="image" src="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/ContactSelectortheGoodandtheBad_14FA0/image_thumb_2.png" border="0" /&gt;&lt;/a&gt;&amp;nbsp;a second time the error would then be displayed. From what I could tell the form was either not posting back to the server correctly or the web version of the form wasn&amp;#39;t being refreshed. As there is no option to force the control to post back to the server. This meant I could end up with a validation error on the form that wasn&amp;#39;t visible to the user but would prevent the from submitting back to the server.&lt;/p&gt; &lt;p&gt;With my first&amp;nbsp;attempt&amp;nbsp;shot down for the time being I decided to take another approach, and add the following code to the Changed Event of the containing group that would remove all existing person records that didn&amp;#39;t exist at Index 1.&lt;/p&gt; &lt;p&gt;if (e.Operation == XmlOperation.Insert) &lt;p&gt;{ &lt;blockquote&gt; &lt;p&gt;for (int i = e.Site.SelectChildren(XPathNodeType.Element).Count; i &amp;gt;= e.Site.SelectChildren(XPathNodeType.Element).Count &amp;amp;&amp;amp; i &amp;gt; 1; i--)&lt;/p&gt;&lt;/blockquote&gt; &lt;blockquote&gt; &lt;p&gt;{&lt;/p&gt;&lt;/blockquote&gt; &lt;blockquote&gt; &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; e.Site.SelectSingleNode(&amp;quot;./my:Person[&amp;quot; + i + &amp;quot;]&amp;quot;, this.NamespaceManager).DeleteSelf();&lt;/p&gt;&lt;/blockquote&gt; &lt;blockquote&gt; &lt;p&gt;}&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;} &lt;p&gt;This code worked pretty well in the client version of the form as well, however once I deployed the form to Form Services I started getting errors from Form Services when I tried to Validate the entered contact or add a contact via the Select button.&lt;/p&gt; &lt;p&gt;Finally with both ideas giving me headaches and not much time left on the project clock I decided to remove my validation code, and email the&amp;nbsp;InfoPath team and see if&amp;nbsp;they had any ideas.&amp;nbsp;Luckily in this circumstance this was not a big issue, as I was using the Contact Selector control as an routing input for a workflow so only the first contact in the control would be used. It would be nice to get a resolution to this though. &lt;/p&gt; &lt;h3&gt;The Good&lt;/h3&gt; &lt;ul&gt; &lt;li&gt;Great way to get login based contact information in your form especially when that data is used in a workflow scenario&lt;/li&gt; &lt;li&gt;Works in both the client and browser based solutions&lt;/li&gt; &lt;li&gt;When used in a client based solution custom code can be added to validate the number of contacts selected&lt;/li&gt;&lt;/ul&gt; &lt;h3&gt;The Bad&lt;/h3&gt; &lt;ul&gt; &lt;li&gt;Can be a little precious about event code when used in a browser based deployment&lt;/li&gt; &lt;li&gt;No out of the box way to limit the number of contacts selected&lt;/li&gt; &lt;li&gt;No way to force the control to post back in a browser based deployment which means the validation errors and underlying data source can get out of sync&lt;/li&gt;&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1019244" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/benwalters/archive/tags/InfoPath+2007/default.aspx">InfoPath 2007</category><category domain="http://msmvps.com/blogs/benwalters/archive/tags/Form+Services/default.aspx">Form Services</category><category domain="http://msmvps.com/blogs/benwalters/archive/tags/Contact+Selector+Control/default.aspx">Contact Selector Control</category><category domain="http://msmvps.com/blogs/benwalters/archive/tags/InfoPath+Form+Development/default.aspx">InfoPath Form Development</category><category domain="http://msmvps.com/blogs/benwalters/archive/tags/SharePoint+2007/default.aspx">SharePoint 2007</category></item><item><title>APAC SharePoint Conference Presentations are now on TechNet!</title><link>http://msmvps.com/blogs/benwalters/archive/2007/06/07/apac-sharepoint-conference-presentations-are-now-on-technet.aspx</link><pubDate>Wed, 06 Jun 2007 22:47:54 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:947013</guid><dc:creator>Ben Walters</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/benwalters/rsscomments.aspx?PostID=947013</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/benwalters/commentapi.aspx?PostID=947013</wfw:comment><comments>http://msmvps.com/blogs/benwalters/archive/2007/06/07/apac-sharepoint-conference-presentations-are-now-on-technet.aspx#comments</comments><description>&lt;p&gt;I received an email last night from my friend Ian Palangio. Letting me know that 1 of our presentations from the APAC SharePoint conference has been posted on &lt;a href="http://technet.microsoft.com/en-au/bb498198.aspx"&gt;TechNet&lt;/a&gt;! &lt;/p&gt; &lt;p&gt;In addition to this there are also links off to a plethora of InfoPath resources.&lt;/p&gt; &lt;p&gt;If InfoPath isn&amp;#39;t your technology of choice there are also resources from all of the other presentations as well so head on over and check it out &lt;a href="http://technet.microsoft.com/en-au/bb498198.aspx"&gt;http://technet.microsoft.com/en-au/bb498198.aspx&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=947013" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/benwalters/archive/tags/InfoPath+2007/default.aspx">InfoPath 2007</category></item><item><title>New book on the block</title><link>http://msmvps.com/blogs/benwalters/archive/2007/06/05/new-book-on-the-block.aspx</link><pubDate>Mon, 04 Jun 2007 23:12:59 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:942922</guid><dc:creator>Ben Walters</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/benwalters/rsscomments.aspx?PostID=942922</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/benwalters/commentapi.aspx?PostID=942922</wfw:comment><comments>http://msmvps.com/blogs/benwalters/archive/2007/06/05/new-book-on-the-block.aspx#comments</comments><description>&lt;p&gt;&lt;/p&gt; &lt;div class="wlWriterSmartContent" id="0767317B-992E-4b12-91E0-4F059A8CECA8:602d800b-2c3b-4cf1-8d78-4520f462d24d" style="padding-right:0px;display:inline;padding-left:0px;padding-bottom:0px;margin:0px;padding-top:0px;"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/InfoPath%202007" rel="tag"&gt;InfoPath 2007&lt;/a&gt;&lt;/div&gt; &lt;table cellspacing="0" cellpadding="2"&gt;  &lt;tr&gt; &lt;td&gt;&amp;nbsp;&lt;/td&gt; &lt;td&gt;&lt;a href="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/Newbookontheblock_8195/51+U0EX5HdL__SS500_.jpg"&gt;&lt;img height="240" alt="51 U0EX5HdL__SS500_" src="http://msmvps.com/blogs/benwalters/WindowsLiveWriter/Newbookontheblock_8195/51+U0EX5HdL__SS500__thumb.jpg" width="240" border="0" /&gt;&lt;/a&gt;&lt;/td&gt; &lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt; &lt;p&gt;For the past couple of months I&amp;#39;ve been working my way through &lt;a href="http://www.amazon.com/Designing-Microsoft-InfoPath-Services-Development/dp/0321410599/ref=pd_bbs_sr_1/102-5921017-8856150?ie=UTF8&amp;amp;s=books&amp;amp;qid=1181980728&amp;amp;sr=8-1" target="_blank"&gt;Designing forms for Microsoft Office InfoPath and Form Services 2007&lt;/a&gt;. This book was written by Scott Roberts and Hagen Green, both who have been working on the InfoPath team from back when it was still known as XDocs. &lt;/p&gt; &lt;p&gt;This is one of the most comprehensive InfoPath books on the market. It makes a very bold claim early on that it will make an InfoPath expert weather your a beginner or an intermediate user, and I have to be&amp;nbsp;honest&amp;nbsp;this is not an unsubstantiated claim this book has information on everything from Client and Web enabled Forms to building template parts and best practices when building forms. This has now become my InfoPath bible all questions from what I&amp;#39;ve read can be answered by the pages within.&lt;/p&gt; &lt;p&gt;If your just starting out with InfoPath or feel you are a seasoned professional this book is for you, so far I haven&amp;#39;t seen it in stores in Australia, so you&amp;#39;ll have to use the link above to get it off amazon. &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=942922" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/benwalters/archive/tags/InfoPath+2007/default.aspx">InfoPath 2007</category></item><item><title>Time to get back into the Blogging way</title><link>http://msmvps.com/blogs/benwalters/archive/2007/03/30/time-to-get-back-into-the-blogging-way.aspx</link><pubDate>Fri, 30 Mar 2007 03:17:36 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:728000</guid><dc:creator>Ben Walters</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/benwalters/rsscomments.aspx?PostID=728000</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/benwalters/commentapi.aspx?PostID=728000</wfw:comment><comments>http://msmvps.com/blogs/benwalters/archive/2007/03/30/time-to-get-back-into-the-blogging-way.aspx#comments</comments><description>&lt;p&gt;My friend &lt;a href="http://www.GrumpyWookie.com"&gt;Chris&lt;/a&gt; made a very accurate observation the other day about my blog I believe his exact words were "Ben your blog has died in the ass" this is very true my bogging of late has been pretty much non-existent.
&lt;/p&gt;&lt;p&gt;The reason for this is that for the past month I have been making my way up the west coast of the US with my wife. You can check out the full details of the trip &lt;a href="http://abinusa.blogspot.com"&gt;here&lt;/a&gt; but you don't need to check out the blog to know it was an awesome trip. 
&lt;/p&gt;&lt;p&gt;So why the month long holiday, well partly because we could and also the MVP world summit was on in Seattle so we figured it would be a good chance to get some holiday time in on the way. 
&lt;/p&gt;&lt;p&gt;But enough about the trip why the sudden urge to start posting again, well mainly because Chris berated me about it &lt;span style="font-family:Wingdings;"&gt;J&lt;/span&gt; but also there a couple of cool things going on at the moment that I thought I should let you all know about.
&lt;/p&gt;&lt;p&gt;Firstly I've been asked to review a book on InfoPath 2007 and Form Services. Apart from being a huge book it seems to be the first decent effort at a single stop place for all your InfoPath questions, I'm not all the way through yet but I'll keep you posted on how it shapes up.
&lt;/p&gt;&lt;p&gt;Secondly the APAC (Australia Pacific) SharePoint Conference for 2007 is on in May, the site is now live so you can register and checkout all the sessions &lt;a href="http://www.microsoftsharepoint.com/"&gt;http://www.microsoftsharepoint.com&lt;/a&gt;
	&lt;/p&gt;&lt;p&gt;Thirdly Nick Barclay (from SDM's Sydney office) has just released a book on &lt;a href="http://www.amazon.com/Rational-Microsoft-Business-Scorecard-Manager/dp/1932577394/ref=pd_bbs_sr_1/102-0888877-0849768?ie=UTF8&amp;amp;s=books&amp;amp;qid=1175224467&amp;amp;sr=8-1"&gt;Business Scorecard Manager&lt;/a&gt; Congratulations Nick! I'm not a big BI person myself but if you are I would recommend checking this one out Nick is one of the most passionate Business Intelligence specialists I know.
&lt;/p&gt;&lt;p&gt;Well that's it for now Chris I hope this quenches your thirst for a post from my blog for the time being. Everyone else I'll catch you on the next post&lt;/p&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=728000" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/benwalters/archive/tags/Business+Scorecard+Manager/default.aspx">Business Scorecard Manager</category><category domain="http://msmvps.com/blogs/benwalters/archive/tags/InfoPath+2007/default.aspx">InfoPath 2007</category></item></channel></rss>