How to call a class from a form

  • Thread starter Thread starter JM
  • Start date Start date
J

JM

Hi,

I instantited a class (Class1) everytime I open a form (form1), and I close
the class (Class1) each time I close form1.
Being form1 open, I open a second form (form2) and I need to call a mehtod
in Class1 from form2. I do not know how I can do it, since Class1 is
instantiated by form1.
Any Help?

Thanks,
jaime
 
You could use a global variable in a module to hold the class reference.
ie Public MyClass as MyClassName

Form1_On_Load

Set MyClass = New MyClassName

Form2
If MyClass is Nothing then . .. .
 
Back
Top