[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 157
  • Last Modified:

getting class vaues from different forms

I have a class a that holds a lot of numbers. My main form provides the class with the numbers. How can i get these values from another form?
0
isnoend2001
Asked:
isnoend2001
  • 5
  • 4
1 Solution
 
Jorge PaulinoIT Pro/DeveloperCommented:
Can you be more clear ?
0
 
isnoend2001Author Commented:
The class has about 15 different properties that hold values how can i access the in more than 1 form
0
 
Jorge PaulinoIT Pro/DeveloperCommented:
You have to do this:

In the class declare the properties as public
' Class
Public Property Let ... ()
Public Property Get... ()

In the module declate the new class
' Module
Public myCls As New myClass

Then in the program you can use it
myCls.myProperty = "Test ..."
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
isnoend2001Author Commented:
jpaulino:
That doesnt work
Heres what i got:

Main form
Declarations
Public newJob As cNumber

Main form load
Set newJob = New cNumber

newJob.hip = 50
newJob.Valley = 65


Need to get these value from another form
0
 
Jorge PaulinoIT Pro/DeveloperCommented:
Change this to module declaration
Public newJob As cNumber
0
 
isnoend2001Author Commented:
None of that worked i decided to write a public function in the man form and get the data from that
0
 
Jorge PaulinoIT Pro/DeveloperCommented:
Thanks for the points but you can do that using a class. Take a look to this example

Direct link to your file
https://filedb.experts-exchange.com/incoming/ee-stuff/6727-Test.zip 

jpaulino
0
 
isnoend2001Author Commented:
Thanks for the example, will use that
0
 
Jorge PaulinoIT Pro/DeveloperCommented:
Just glad I could help!
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now