
Passing a form to a sub in a module
How do you spawn each form? probably something like this,
Dim formvar1 as new form1 (or whatever your formname is)
dim formvar2 as new form2
dim formvar3 as new form3
then you can open them like so,
formvar2.showdialog(me)
that will spawn that form, now when you close that form or whatever, you can
reference that combobox from your main form like this
formvar2.cboClient
I "hope" this make sense. if you need anymore help just lemme know, I am
new to this too, but I am learning pretty well.
good luck
Quote:
> I have 3 forms that each have a clientlist combobox. Before these forms
are
> shown, the combobox is filled with my clientlist.
> The code for each is exactly the same so I have created a sub
FillClientList
> in a module and made it public
> My problem is, how do I pass the form that the combobox is on to this
> routine?
> I tried Sub FillClientList (ByVal frm as Form)
> frm.cboClient.items.add ... etc
> frm.cboClient is underlined and tells me the cboClient is not a part of
> System.Windows.Forms.Form
> Sorry, I'm too new at this to understand what I need to do
> Thanks
> Charlie