Access Variables in Other Forms

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gumdealer328
    New Member
    • Feb 2008
    • 9

    Access Variables in Other Forms

    I have multiple forms and in the 2nd form i access some variables and get there values which are added up by the function in the cost class. when i put

    "Dim TotalCost as New Cost"

    does that clear the variables in the class?

    how can i access these variables in other forms without having to reset them?
  • gobblegob
    New Member
    • Dec 2007
    • 133

    #2
    Hi Gimdealer,

    Create a new module, and declare the variables in that:

    Public myvar1 As String

    Give this a go
    Gobble.


    Originally posted by gumdealer328
    I have multiple forms and in the 2nd form i access some variables and get there values which are added up by the function in the cost class. when i put

    "Dim TotalCost as New Cost"

    does that clear the variables in the class?

    how can i access these variables in other forms without having to reset them?

    Comment

    • gumdealer328
      New Member
      • Feb 2008
      • 9

      #3
      Originally posted by gobblegob
      Hi Gimdealer,

      Create a new module, and declare the variables in that:

      Public myvar1 As String

      Give this a go
      Gobble.
      thx i got it to work by using a public variable and accessing that variable from the other form by using frmSize.variabl e.

      Comment

      Working...