<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://customerfx.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>Jason Buss&amp;#39; Blog : How-To, Forms, Basics</title><link>http://customerfx.com/pages/customization/archive/tags/How-To/Forms/Basics/default.aspx</link><description>Tags: How-To, Forms, Basics</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP2 (Build: 20611.960)</generator><item><title>Using the Forms collection in the SalesLogix LAN client</title><link>http://customerfx.com/pages/customization/2009/06/24/using-the-forms-collection-in-the-saleslogix-lan-client.aspx</link><pubDate>Wed, 24 Jun 2009 17:56:00 GMT</pubDate><guid isPermaLink="false">e15581aa-2787-4c59-a940-524c09f5d256:40626</guid><dc:creator>Jason Buss</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://customerfx.com/pages/customization/rsscomments.aspx?PostID=40626</wfw:commentRss><comments>http://customerfx.com/pages/customization/2009/06/24/using-the-forms-collection-in-the-saleslogix-lan-client.aspx#comments</comments><description>&lt;p&gt;From time to time, you may find that you want to reference a control or script on a form other than the one you are currently on.&amp;nbsp; This can be done easily using the Forms collection in SalesLogix.&amp;nbsp; &lt;br /&gt;&lt;/p&gt;&lt;p&gt;The first thing we need to do is to loop through all open forms, checking for the desired form.&amp;nbsp; For this example, we&amp;#39;ll look for the Contact Detail form.&amp;nbsp; (Note:&amp;nbsp; we&amp;#39;re looking for the value contained within the &amp;quot;Name&amp;quot; property of the form we are looking for.):&lt;br /&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim frm&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim x&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; For x = 0 to Application.Forms.Count - 1&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If Application.Forms(x).Name = &amp;quot;frmContactDetail&amp;quot; Then&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set frm = Application.Forms(x)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exit For&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next &lt;br /&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;Once this code runs, we should have an object (frm) containing a reference to that form.&amp;nbsp; If the form is not found, the code will return null, which we should look for before trying to manipulate anything&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If Not frm Is Nothing Then&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If &lt;br /&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;Any references should be done within that IF statement.&amp;nbsp; To access properties, you just need to include the form object (frm.&lt;i&gt;{control}.{property}&lt;/i&gt;).&amp;nbsp; For scripts, you&amp;#39;ll need to access the forms Scripts collection (frm.scripts.&lt;i&gt;{sub or function name}&lt;/i&gt;)&lt;/p&gt;&lt;p&gt;That&amp;#39;s all there is to it.&amp;nbsp; All in all, pretty easy, right? &lt;br /&gt;&lt;/p&gt;&lt;p&gt;Keep in mind,&amp;nbsp; this does require that the form you want to reference actually be open. &amp;nbsp; If you want access to information to information on an uninitiated form, you&amp;#39;ll need to access the appropriate tables directly.&lt;/p&gt;&lt;p&gt;Hope you find this post helpful.&amp;nbsp; Thanks again for reading&amp;nbsp;&lt;img src="http://customerfx.com/emoticons/emotion-1.gif" alt="Smile" /&gt; &lt;br /&gt;&lt;/p&gt;&lt;img src="http://customerfx.com/aggbug.aspx?PostID=40626" width="1" height="1"&gt;</description><category domain="http://customerfx.com/pages/customization/archive/tags/Basics/default.aspx">Basics</category><category domain="http://customerfx.com/pages/customization/archive/tags/Customizations/default.aspx">Customizations</category><category domain="http://customerfx.com/pages/customization/archive/tags/Development/default.aspx">Development</category><category domain="http://customerfx.com/pages/customization/archive/tags/Forms/default.aspx">Forms</category><category domain="http://customerfx.com/pages/customization/archive/tags/Forms+Collection/default.aspx">Forms Collection</category><category domain="http://customerfx.com/pages/customization/archive/tags/How-To/default.aspx">How-To</category><category domain="http://customerfx.com/pages/customization/archive/tags/SalesLogix/default.aspx">SalesLogix</category><category domain="http://customerfx.com/pages/customization/archive/tags/SalesLogix+LAN+Client/default.aspx">SalesLogix LAN Client</category><category domain="http://customerfx.com/pages/customization/archive/tags/scripting/default.aspx">scripting</category><category domain="http://customerfx.com/pages/customization/archive/tags/vbscript/default.aspx">vbscript</category></item></channel></rss>