<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How do I pass a form to a function? in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-do-i-pass-a-form-to-a-function/m-p/277401#M7141</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Here's an mxd (version 9.3.1) that contains two user forms and module with a public method for loading a combobox.&amp;nbsp; Both of the forms call this method in their Initialize event.&amp;nbsp; Hopefully this will help!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 01 Apr 2011 17:28:01 GMT</pubDate>
    <dc:creator>NeilClemmons</dc:creator>
    <dc:date>2011-04-01T17:28:01Z</dc:date>
    <item>
      <title>How do I pass a form to a function?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-do-i-pass-a-form-to-a-function/m-p/277393#M7133</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;How do I pass a form to a function? &lt;/STRONG&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Since I have multiple forms which each contain a combo box listing the same Editor names, I am trying to programmatically pass each form (at initialization) to a function which populates the Editor Names combo box with the desired values (from a standalone table). My code is below:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; Private Sub UserForm_Initialize()[INDENT]PopulateEditorNameComboBox(&lt;/SPAN&gt;&lt;STRONG&gt;thisForm&lt;/STRONG&gt;&lt;SPAN&gt;) 'Call function from form[/INDENT]End Sub&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Public Function PopulateEditorNameComboBox(&lt;/SPAN&gt;&lt;STRONG&gt;passedForm&lt;/STRONG&gt;&lt;SPAN&gt; as &amp;lt;?&amp;gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]For i = 1 to EditorNameCollection.Count&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]&lt;/SPAN&gt;&lt;STRONG&gt;passedForm&lt;/STRONG&gt;&lt;SPAN&gt;.cboEditor.AddItem (EditorNameCollection.item(i)) 'Add item to combo box on indicated form[/INDENT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Next i[/INDENT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End Function&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks, Jill USFS Region 6&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Mar 2011 21:29:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-do-i-pass-a-form-to-a-function/m-p/277393#M7133</guid>
      <dc:creator>JillFritz</dc:creator>
      <dc:date>2011-03-31T21:29:18Z</dc:date>
    </item>
    <item>
      <title>Re: How do I pass a form to a function?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-do-i-pass-a-form-to-a-function/m-p/277394#M7134</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Well, not quite sure what you are trying to attempt.. but I see a few things.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;a) There is NO need for a function, your not sending a return value.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;so&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;as for the Form. IF its all in the same CLASS, just use me. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Are you suggesting that sub UserForm is a Different form than THISForm?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Private Sub UserForm_Initialize()

&amp;nbsp;&amp;nbsp;&amp;nbsp; PopulateEditorNameComboBox()

End Sub


Public Sub PopulateEditorNameComboBox()

&amp;nbsp;&amp;nbsp;&amp;nbsp; For i = 1 to EditorNameCollection.Count

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; me.cboEditor.AddItem (EditorNameCollection.item(i)) 'Add item to combo box on indicated form

&amp;nbsp;&amp;nbsp;&amp;nbsp; Next i

End Function
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There are many methods to pass data between forms if that is what you are doing...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Delegates / Properties /contructor / object&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:17:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-do-i-pass-a-form-to-a-function/m-p/277394#M7134</guid>
      <dc:creator>MichaelRobb</dc:creator>
      <dc:date>2021-12-12T16:17:06Z</dc:date>
    </item>
    <item>
      <title>Re: How do I pass a form to a function?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-do-i-pass-a-form-to-a-function/m-p/277395#M7135</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If I only needed the function to load the combo box on one form, I could simply type FormName.cboEditor.AddItem and the function would work fine. The form name would be essentially "hard-coded" and I would not need to pass any argument. (I tested this and it works well).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to use my external function, named PopulateEditorNameComboBox (which is located in the Modules folder), to populate the same combo box located on several forms. In other words,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If Form1 calls the function, then the function performs Form1.cboEditor.AddItem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If Form2 calls the function, then the function performs Form2.cboEditor.AddItem&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If Form3 calls the function, then the function performs Form3.cboEditor.AddItem and so on.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A non-object variable, such as a string or variant variable named passedForm for example (passedForm.cboEditor.AddItem) returns an error of "Object doesn't support this object or method".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="color:&amp;quot;blue&amp;quot;;"&gt;&lt;STRONG&gt;I am looking for help on what argument assignment (i.e. passedForm as &amp;lt;???&amp;gt;) to use to make this work.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/459742"&gt;@Mike&lt;/a&gt;.robb:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for responding to my post. "Me" is a VBA keyword that a form uses to refer to itself (I am more accustomed to using this in Excel or Access); so I would not expect this to work in an external function. Nevertheless, I attempted &lt;/SPAN&gt;&lt;SPAN style="color:&amp;quot;red&amp;quot;;"&gt;me&lt;/SPAN&gt;&lt;SPAN&gt;.cboEditor.AddItem (AddressCollection.item(i)) which returned a "Compile error: Invalid use of Me keyword". &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regarding your statement that there is no need for a function: The function returns a boolean value which is not evident in the trimmed code I included in my post (extraneous code was not pertinent to my question)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regarding your confusion about my use of UserForm and thisForm: UserForm_Initialize is built-in, default syntax for initialization of any form regardless of form name. In other words, if you have 3 forms (Form 1, Form 2, and Form 3), each form will have an initialization subroutine of "Private Sub UserForm_Intialize().&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for the opportunity to better clarify what I need.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards, Jill USFS Region 6&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt; Well, not quite sure what you are trying to attempt.. but I see a few things.&amp;nbsp; &lt;BR /&gt;a) There is NO need for a function, your not sending a return value.&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt;so&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt;as for the Form. IF its all in the same CLASS, just use me.&amp;nbsp;&amp;nbsp; &lt;BR /&gt;Are you suggesting that sub&amp;nbsp;&amp;nbsp; &lt;SPAN style="color:&amp;quot;Blue&amp;quot;;"&gt;UserForm&lt;/SPAN&gt; is a Different form than&amp;nbsp;&amp;nbsp; &lt;SPAN style="color:&amp;quot;Blue&amp;quot;;"&gt;THISForm&lt;/SPAN&gt;?&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; &lt;PRE class="lia-code-sample line-numbers language-none"&gt;Private Sub UserForm_Initialize()

&amp;nbsp;&amp;nbsp;&amp;nbsp; PopulateEditorNameComboBox()

End Sub


Public Sub PopulateEditorNameComboBox()

&amp;nbsp;&amp;nbsp;&amp;nbsp; For i = 1 to EditorNameCollection.Count

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; me.cboEditor.AddItem (EditorNameCollection.item(i)) 'Add item to combo box on indicated form

&amp;nbsp;&amp;nbsp;&amp;nbsp; Next i

End Function
&lt;/PRE&gt; &lt;BR /&gt; &lt;BR /&gt;There are many methods to pass data between forms if that is what you are doing...&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt;Delegates / Properties /contructor / object&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:29:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-do-i-pass-a-form-to-a-function/m-p/277395#M7135</guid>
      <dc:creator>JillFritz</dc:creator>
      <dc:date>2021-12-11T13:29:57Z</dc:date>
    </item>
    <item>
      <title>Re: How do I pass a form to a function?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-do-i-pass-a-form-to-a-function/m-p/277396#M7136</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Since the method is loading a combobox, pass in the combobox, not the form.&amp;nbsp; If you pass in the form then the method will not know which control on the form it should be loading.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Public Function LoadCombobox(comboBox As ComboBox) As Boolean
&amp;nbsp; ' do whatever.
End Function

' call the method from the form.
LoadComboBox(Me.theCombobox)
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:30:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-do-i-pass-a-form-to-a-function/m-p/277396#M7136</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2021-12-11T13:30:00Z</dc:date>
    </item>
    <item>
      <title>Re: How do I pass a form to a function?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-do-i-pass-a-form-to-a-function/m-p/277397#M7137</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Neil, using the following code with your recommended changes, I received an error "Object required". Did I misinterpret your instructions?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Private Sub UserForm_Initialize()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;On Error GoTo EH&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT] &lt;/SPAN&gt;&lt;SPAN style="color:&amp;quot;darkgreen&amp;quot;;"&gt;'Load Editor combobox&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;PopulateComboBoxes (Me.cboEditor)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; If cboEditor.ListIndex &amp;gt; 0 Then cboEditor.ListIndex = gi_Editor[/INDENT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Exit Sub&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;EH:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; MsgBox Err.Description, vbInformation, "Initialize Annotation Edit Form"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End Sub&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt; Since the method is loading a combobox, pass in the combobox, not the form. If you pass in the form then the method will not know which control on the form it should be loading.&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt; &lt;PRE class="lia-code-sample line-numbers language-none"&gt;Public Function LoadCombobox(comboBox As ComboBox) As Boolean
&amp;nbsp; ' do whatever.
End Function

' call the method from the form.
LoadComboBox(Me.theCombobox)
&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:30:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-do-i-pass-a-form-to-a-function/m-p/277397#M7137</guid>
      <dc:creator>JillFritz</dc:creator>
      <dc:date>2021-12-11T13:30:02Z</dc:date>
    </item>
    <item>
      <title>Re: How do I pass a form to a function?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-do-i-pass-a-form-to-a-function/m-p/277398#M7138</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;What does your PopulateComboboxes method look like now?&amp;nbsp; You should have changed the method definition to take a combobox as a parameter and also updated the code to reference this parameter.&amp;nbsp; Something like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Public Function PopulateComboxes(combobox as Combobox)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; combobox.AddItem("hello")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; combobox.AddItem("world")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End Function&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Apr 2011 16:40:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-do-i-pass-a-form-to-a-function/m-p/277398#M7138</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2011-04-01T16:40:30Z</dc:date>
    </item>
    <item>
      <title>Re: How do I pass a form to a function?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-do-i-pass-a-form-to-a-function/m-p/277399#M7139</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Public Function PopulateComboBoxes(cboEditor As ComboBox) as Boolean&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [INDENT]cboEditor.AddItem (AddressCollection.item(i))[/INDENT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End Function&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The error occurs in the UserForm_Initialize subroutine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;What does your PopulateComboboxes method look like now?&amp;nbsp; You should have changed the method definition to take a combobox as a parameter and also updated the code to reference this parameter.&amp;nbsp; Something like this:&lt;BR /&gt;&lt;BR /&gt;Public Function PopulateComboxes(combobox as Combobox)&lt;BR /&gt;&amp;nbsp; combobox.AddItem("hello")&lt;BR /&gt;&amp;nbsp; combobox.AddItem("world")&lt;BR /&gt;End Function&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Apr 2011 16:43:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-do-i-pass-a-form-to-a-function/m-p/277399#M7139</guid>
      <dc:creator>JillFritz</dc:creator>
      <dc:date>2011-04-01T16:43:59Z</dc:date>
    </item>
    <item>
      <title>Re: How do I pass a form to a function?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-do-i-pass-a-form-to-a-function/m-p/277400#M7140</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;My apologies for mis-understanding, Jill.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I suggested My. as within a class, that works in .net for any form and yes, of course it would not work if the function is outside the form class.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am aware every form will have an initialize, its Private Sub InitializeComponent() or your probably referring to FormLoad ? there is no Initialize as you put it that I see in vb.net for a declaration.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So the function is all on its own (separate class). Ok, which is calling a table.&amp;nbsp; Sorry, I would just have the function in each form class... not sure how this would be achieved.&amp;nbsp; Neil will hopefully guide you in the right direction and I will learn something.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Apr 2011 17:04:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-do-i-pass-a-form-to-a-function/m-p/277400#M7140</guid>
      <dc:creator>MichaelRobb</dc:creator>
      <dc:date>2011-04-01T17:04:31Z</dc:date>
    </item>
    <item>
      <title>Re: How do I pass a form to a function?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-do-i-pass-a-form-to-a-function/m-p/277401#M7141</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Here's an mxd (version 9.3.1) that contains two user forms and module with a public method for loading a combobox.&amp;nbsp; Both of the forms call this method in their Initialize event.&amp;nbsp; Hopefully this will help!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Apr 2011 17:28:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-do-i-pass-a-form-to-a-function/m-p/277401#M7141</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2011-04-01T17:28:01Z</dc:date>
    </item>
    <item>
      <title>Re: How do I pass a form to a function?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-do-i-pass-a-form-to-a-function/m-p/277402#M7142</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you. Thank you, Neil!!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This did it (passing 3 combo boxes):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Private Sub UserForm_Initialize&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]PopulateComboBoxes &lt;/SPAN&gt;&lt;SPAN style="color:&amp;quot;blue&amp;quot;;"&gt;cboEditor, cboForest, cboSourceCode &lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;SPAN style="color:&amp;quot;darkgreen&amp;quot;;"&gt;'Without the "me" or enclosing parentheses!!&lt;/SPAN&gt;&lt;SPAN&gt;[/INDENT]End Sub&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Public Function PopulateComboBoxes(&lt;/SPAN&gt;&lt;SPAN style="color:&amp;quot;blue&amp;quot;;"&gt;cboEditor as ComboBox, cboForest as ComboBox, cboSourceCode as ComboBox&lt;/SPAN&gt;&lt;SPAN&gt;) as Boolean&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]do stuff[/INDENT]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End Function&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jill, USFS Region 6&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ecohydrologist (ESRI Global Account)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;previously known as "geophotog" (GIS Online Account)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt; Here's an mxd (version 9.3.1) that contains two user forms and module with a public method for loading a combobox. Both of the forms call this method in their Initialize event. Hopefully this will help!&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Apr 2011 18:31:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-do-i-pass-a-form-to-a-function/m-p/277402#M7142</guid>
      <dc:creator>JillMasters</dc:creator>
      <dc:date>2011-04-01T18:31:00Z</dc:date>
    </item>
  </channel>
</rss>

