Roy,
You need to distinguish between a class module, which contains the VBA
code that defines the class, and the instances of the class that are
created by code running elsewhere in the application.
From what you say, it sounds as if a global Collection is what you need.
Declare it n a code module (not a form or class module):
Public gcolMyObjects As Collection
Then, in code behind a form (or in a code module), you can do something
like this:
Dim oMyClass As MyClass
Dim strKey As String
...
Set oMyClass = New MyClass
With oMyClass
'set properties etc.
End With
'if desired, create a key value for the object
strKey = "blah_blah" 'maybe give this the same
'value as oMyClass's Name
'or ID property if it has one?
'add it to the collection
gcolMyObjects.Add oMyClass, strKey
'maybe store strKey in a table or somewhere so it can
'easily be found later
'release the variable
Set oMyClass = Nothing
You now have the globally-accessible Collection containing the object.
You can repeat as desired to add more objects to the Collection, and you
can access them from anywhere in the application like this:
gcolMyObjects("blah_blah")
or
gColMyObjects(1)
Whell John
I have some complex structurs that it is very hard to manage them on
runtime.
The best way i could see that works is by using Object oriented.
For this i'm using class module who do anything, keeps data inside.
And for achive this i need that every form i'm run from it can reach it and
get information from it or even update the class module
Like ActiveX dll works, that have main class module who runs everything
Is there a way to do this?