Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting Data From a Class

Status
Not open for further replies.

rccoates

Programmer
Nov 8, 2001
8
US
I have created two forms. In one form I have Instantiated a class. Within that class is an array. In the other form I need to get that data from the array in that class. If I instantiate a new class I won't see the data. How do I connect to the class with the second form and see the data that the first form can see.
Thanks
Ron
 
One way to do it is to create a manager class which handles the creation of the forms and the class. This would mean that the class does not belong to any form, but gets instantiated by the manager class. In both forms, you can create references to the manager class and (if you make the instantiated class a public property) then the forms can access the class. Ladyhawk. [idea]
** ASP/VB/Java Programmer **
 
Put the instance (object) reference in a .BAS Module so that you can get it even after Form1 is unloaded and terminated. Put it in a Public variable.

'Form1
Set MyPublicModule.MyWhat = New clsWhat

'MyPublicModule
Public MyWhat as clsWhat




Generate Forms/Controls Resizing/Tabbing Class
Compare Code (Text)
Generate Sort Class in VB or VBScript
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top