-
Global Variabiles
I'm tring to use a global variable, but I got some problems.
here the architeture of my VBA.
1. I create a Class Module named DatiVent
Code:
Option Explicit
Private m_Famiglia As String
private m_Name As string
.....
Public Property Get GetFamiglia() As String
Famiglia = m_Famiglia
End Property
Public Property Set SetFamiglia(value)
m_Famiglia = value
End Property
.....
2. then I create a Module named VarVENT where I create a public variable
Code:
Public VARIABILI As DatiVent
3. I'm tring to use the variable in a Form object:
Code:
VARIABILI.SetFamiglia ("PIPPO")
it dosen't work, I'm not an expert, This is the first time I'm using a more complex architeture, someone could help me?
thank you in advance
-
Clas
Code:
Option Explicit
Private m_Famiglia As String
Private m_Name As String
Public Property Get Famiglia() As String
Famiglia = m_Famiglia
End Property
Public Property Let Famiglia(value As String)
m_Famiglia = value
End Property
managing module
Code:
Set VARIABILI = New DatiVent
VARIABILI.Famiglia = "PIPPO"
MsgBox VARIABILI.Famiglia
-
Thank you XLD,
your suggestion works, but in that way the variables "VARIABILI" is only available in the object where I made the "SET", have you any ideas to made possible to read and write in the "VARIABILI" even outside his object?
thank you in advance
-
You do read/write it outside of is object, as I showed in the managing module code, but you have to reference it via the object. That is the whole rationale of objects.