G
Guest
I am having problems passing a collection object to other class modules.
First, I define the collection object in a separate class module (i.e. Dim
foo As Collection). Next, I create an instance of the object (i.e., Set foo
= new Collection) in the “Private Sub Form_Load()†routine of my Form
Module.
Next I pass the 'foo' object to a standard class module (i.e.,
clsFormManager – Public Sub getTableItems). The getTableItems sub passes the
'foo' object to another class module (clsDBManager – Public Sub readDBTable).
The readDBTable routine opens the database and adds items to the 'foo'
collection object and returns.
When I return to the getTableItems routine and try to access the data from
the 'foo' collection, I get the following run time error: “Run-Time Error
‘3420 – Object is no longer validâ€
All the variables are passed by references. Can anyone help with the bug?
Thanks,
Eddie Eytchison
First, I define the collection object in a separate class module (i.e. Dim
foo As Collection). Next, I create an instance of the object (i.e., Set foo
= new Collection) in the “Private Sub Form_Load()†routine of my Form
Module.
Next I pass the 'foo' object to a standard class module (i.e.,
clsFormManager – Public Sub getTableItems). The getTableItems sub passes the
'foo' object to another class module (clsDBManager – Public Sub readDBTable).
The readDBTable routine opens the database and adds items to the 'foo'
collection object and returns.
When I return to the getTableItems routine and try to access the data from
the 'foo' collection, I get the following run time error: “Run-Time Error
‘3420 – Object is no longer validâ€
All the variables are passed by references. Can anyone help with the bug?
Thanks,
Eddie Eytchison