<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>How to populate a Multi-Select list box in Code</title><link>https://www.infopathdev.com:443/forums/thread/75371.aspx</link><pubDate>Thu, 16 Feb 2012 13:11:21 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:75371</guid><dc:creator>RonInOttawa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/75371.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=75371</wfw:commentRss><description>&lt;p&gt;Hello;&lt;/p&gt;
&lt;p&gt;I have a form that users typically fill out manually to request exceptions to our processes. However, because of the results of a SOX audit, we need to fill out a copy&amp;nbsp;form for each and every employee to document document grandfathered exceptions. I&amp;#39;m getting all of the information to fill out the form from our HR Database and Some from ActiveDirectory.&lt;/p&gt;
&lt;p&gt;One of the fields on the form is a Multi-Select list box that shows the type of Remote Access a user is requesting. Since we&amp;#39;re backtraking here, I know what they have from the LDAP query, so I need to populate one to four of the 4 items in the Multi-Select list box. I can do 1 and only 1 - Doesn&amp;#39;t matter what the value is it puts the check in the right place.&lt;/p&gt;
&lt;p&gt;If I do something like the following...&lt;/p&gt;&lt;span style="FONT-FAMILY:&amp;#39;Courier New&amp;#39;;COLOR:blue;FONT-SIZE:9pt;mso-no-proof:yes;"&gt;If&lt;/span&gt;&lt;span style="FONT-FAMILY:&amp;#39;Courier New&amp;#39;;FONT-SIZE:9pt;mso-no-proof:yes;"&gt; Citrix &lt;span style="COLOR:blue;"&gt;Then&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-FAMILY:&amp;#39;Courier New&amp;#39;;FONT-SIZE:9pt;mso-no-proof:yes;"&gt;&amp;nbsp;&lt;/span&gt; 
&lt;p&gt;&lt;span style="FONT-FAMILY:&amp;#39;Courier New&amp;#39;;FONT-SIZE:9pt;mso-no-proof:yes;"&gt;Nav.SelectSingleNode(&lt;span style="COLOR:#a31515;"&gt;&amp;quot;/my:FunctionalTemplate/my:VarianceDetail/my:Remote/my:RemoteAccessTypes&amp;quot;&lt;/span&gt;, ns).SetValue(&lt;span style="COLOR:#a31515;"&gt;&amp;quot;CITRIX&amp;quot;&lt;/span&gt;)&lt;/span&gt;&lt;/p&gt;&lt;span style="FONT-FAMILY:&amp;#39;Courier New&amp;#39;;FONT-SIZE:9pt;mso-no-proof:yes;"&gt;&lt;/span&gt;&lt;span style="FONT-FAMILY:&amp;#39;Courier New&amp;#39;;COLOR:blue;FONT-SIZE:9pt;mso-no-proof:yes;"&gt;End&lt;/span&gt;&lt;span style="FONT-FAMILY:&amp;#39;Courier New&amp;#39;;FONT-SIZE:9pt;mso-no-proof:yes;"&gt; &lt;span style="COLOR:blue;"&gt;If&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-FAMILY:&amp;#39;Courier New&amp;#39;;FONT-SIZE:9pt;mso-no-proof:yes;"&gt;&lt;span style="COLOR:blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-FAMILY:&amp;#39;Courier New&amp;#39;;FONT-SIZE:9pt;mso-no-proof:yes;"&gt;&lt;span style="COLOR:blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-FAMILY:&amp;#39;Courier New&amp;#39;;COLOR:blue;FONT-SIZE:9pt;mso-no-proof:yes;"&gt;If&lt;/span&gt;&lt;span style="FONT-FAMILY:&amp;#39;Courier New&amp;#39;;FONT-SIZE:9pt;mso-no-proof:yes;"&gt; MailX &lt;span style="COLOR:blue;"&gt;Then&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-FAMILY:&amp;#39;Courier New&amp;#39;;FONT-SIZE:9pt;mso-no-proof:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;
&lt;p&gt;&lt;span style="FONT-FAMILY:&amp;#39;Courier New&amp;#39;;FONT-SIZE:9pt;mso-no-proof:yes;"&gt;Nav.SelectSingleNode(&lt;span style="COLOR:#a31515;"&gt;&amp;quot;/my:FunctionalTemplate/my:VarianceDetail/my:Remote/my:RemoteAccessTypes/my:RemoteAccessType&amp;quot;&lt;/span&gt;, ns).SetValue(&lt;span style="COLOR:#a31515;"&gt;&amp;quot;MailX&amp;quot;&lt;/span&gt;)&lt;/span&gt;&lt;/p&gt;&lt;span style="FONT-FAMILY:&amp;#39;Courier New&amp;#39;;FONT-SIZE:9pt;mso-no-proof:yes;"&gt;&lt;/span&gt;&lt;span style="FONT-FAMILY:&amp;#39;Courier New&amp;#39;;COLOR:blue;FONT-SIZE:9pt;mso-no-proof:yes;"&gt;End&lt;/span&gt;&lt;span style="FONT-FAMILY:&amp;#39;Courier New&amp;#39;;FONT-SIZE:9pt;mso-no-proof:yes;"&gt; &lt;span style="COLOR:blue;"&gt;If&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-FAMILY:&amp;#39;Courier New&amp;#39;;FONT-SIZE:9pt;mso-no-proof:yes;"&gt;&lt;span style="COLOR:blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-FAMILY:&amp;#39;Courier New&amp;#39;;FONT-SIZE:9pt;mso-no-proof:yes;"&gt;&lt;span style="COLOR:blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-FAMILY:&amp;#39;Courier New&amp;#39;;COLOR:blue;FONT-SIZE:9pt;mso-no-proof:yes;"&gt;If&lt;/span&gt;&lt;span style="FONT-FAMILY:&amp;#39;Courier New&amp;#39;;FONT-SIZE:9pt;mso-no-proof:yes;"&gt; VPN &lt;span style="COLOR:blue;"&gt;Then&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-FAMILY:&amp;#39;Courier New&amp;#39;;FONT-SIZE:9pt;mso-no-proof:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;
&lt;p&gt;&lt;span style="FONT-FAMILY:&amp;#39;Courier New&amp;#39;;FONT-SIZE:9pt;mso-no-proof:yes;"&gt;Nav.SelectSingleNode(&lt;span style="COLOR:#a31515;"&gt;&amp;quot;/my:FunctionalTemplate/my:VarianceDetail/my:Remote/my:RemoteAccessTypes/my:RemoteAccessType&amp;quot;&lt;/span&gt;, ns).SetValue(&lt;span style="COLOR:#a31515;"&gt;&amp;quot;VPN&amp;quot;&lt;/span&gt;)&lt;/span&gt;&lt;/p&gt;&lt;span style="FONT-FAMILY:&amp;#39;Courier New&amp;#39;;FONT-SIZE:9pt;mso-no-proof:yes;"&gt;&lt;/span&gt;&lt;span style="FONT-FAMILY:&amp;#39;Courier New&amp;#39;;COLOR:blue;FONT-SIZE:9pt;mso-no-proof:yes;"&gt;End&lt;/span&gt;&lt;span style="FONT-FAMILY:&amp;#39;Courier New&amp;#39;;FONT-SIZE:9pt;mso-no-proof:yes;"&gt; &lt;span style="COLOR:blue;"&gt;If&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-FAMILY:&amp;#39;Courier New&amp;#39;;FONT-SIZE:9pt;mso-no-proof:yes;"&gt;&lt;span style="COLOR:blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-FAMILY:&amp;#39;Courier New&amp;#39;;FONT-SIZE:9pt;mso-no-proof:yes;"&gt;&lt;span style="COLOR:blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-FAMILY:&amp;#39;Courier New&amp;#39;;COLOR:blue;FONT-SIZE:9pt;mso-no-proof:yes;"&gt;If&lt;/span&gt;&lt;span style="FONT-FAMILY:&amp;#39;Courier New&amp;#39;;FONT-SIZE:9pt;mso-no-proof:yes;"&gt; RDP &lt;span style="COLOR:blue;"&gt;Then&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-FAMILY:&amp;#39;Courier New&amp;#39;;FONT-SIZE:9pt;mso-no-proof:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;
&lt;p&gt;&lt;span style="FONT-FAMILY:&amp;#39;Courier New&amp;#39;;FONT-SIZE:9pt;mso-no-proof:yes;"&gt;Nav.SelectSingleNode(&lt;span style="COLOR:#a31515;"&gt;&amp;quot;/my:FunctionalTemplate/my:VarianceDetail/my:Remote/my:RemoteAccessTypes/my:RemoteAccessType&amp;quot;&lt;/span&gt;, ns).SetValue(&lt;span style="COLOR:#a31515;"&gt;&amp;quot;RDP&amp;quot;&lt;/span&gt;)&lt;/span&gt;&lt;/p&gt;&lt;span style="FONT-FAMILY:&amp;#39;Courier New&amp;#39;;FONT-SIZE:9pt;mso-no-proof:yes;"&gt;&lt;/span&gt;&lt;span style="FONT-FAMILY:&amp;#39;Courier New&amp;#39;;COLOR:blue;FONT-SIZE:9pt;mso-no-proof:yes;"&gt;End&lt;/span&gt;&lt;span style="FONT-FAMILY:&amp;#39;Courier New&amp;#39;;FONT-SIZE:9pt;mso-no-proof:yes;"&gt; &lt;span style="COLOR:blue;"&gt;If&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-FAMILY:&amp;#39;Courier New&amp;#39;;FONT-SIZE:9pt;"&gt;&lt;/span&gt; 
&lt;p&gt;Then I get an &amp;quot;Schema validation found non-data type errors.&amp;quot; error because the second, third or fourth elements don&amp;#39;t exist.&lt;/p&gt;
&lt;p&gt;Any ideas on how I can select the various items on the Multi-Select List Box?&lt;/p&gt;
&lt;p&gt;Thanks for all help/suggestions in advance.&lt;/p&gt;
&lt;p&gt;Ron...&lt;/p&gt;</description></item></channel></rss>