How to FREE resources (system resources) when loading & unloading instances of the same form?

Hi!

I am loading & unloading instances of the same form, but when I unload one of the form's instances (with "unload form1(x)" ...) nothing happends.

I searched through the MSDN and found some proposed answers (freeing resources) but that does NOT work.

Do you have an answer?


here is how I create those forms:

in module:
dim xxxx as form1

in code:

redim xxxx (1 to 200) as form1

then I show and close those forms.

THANX!

Igor.
kojotAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
mcriderConnect With a Mentor Commented:
That email address doesn't work...
0
 
mcriderCommented:
Try this:

In a MODULE:

     Global xxxx() As Form1

In Code:

     Redim xxxx(1 to 200) As Form1

Then to show the first form:

     Set xxxx(1) = New Form1
     xxxx(1).Show
     
To unload the first form:

     Unload xxxx(1)
     Set xxxx(1) = Nothing



Cheers!
0
 
kojotAuthor Commented:
I've allready tried that and it doesn't work. Resources just get lower and lower when I load a form I've unloaded before.

Thank you for your answer, but it doesn't work.


Igor.
0
What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

 
mcriderCommented:
You tried the "Set xxxx(1) = Nothing"???

It works PERFECTLY on my system...
0
 
kojotAuthor Commented:
Yes .. but nothing happend .. damn:) If you'd like I can send you my project and you can see for yourselve.

mail me at: maverick@maverick-int.si

Igor.
0
 
kojotAuthor Commented:
What? OK .. maybe there are problems with servers .. put your email adress here and I'll send you  the code.

Igor.
0
 
kojotAuthor Commented:
Ok .. my fault .. an OCX was still active while i was trying to close the form. That worx. 10x!
0
 
mcriderCommented:
Thanks for the points. Glad I could help!


Cheers!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.