How to call a class from a form

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
 
J

JohnFol

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 . .. .
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top