I created a property in a class module called clsProperties:
Dim blnProduction As Boolean
Public Property Get IsProduction() As Boolean
IsProduction = blnProduction
End Property
Public Property Let IsProduction(ByVal vNewValue As Boolean)
blnProduction = vNewValue
End Property
I then call the Let statement from a form:
Private objPropertiesAs New clsProperties
'Determine if we're in production
If (Environ("computername")) = "WS0006" Then
objPropertiesAs.IsProduction = True
Else
objPropertiesAs.IsProduction = False
End If
I test the code using "WS006" and IsProduction will be equal to True. However, when I try to access the Get in clsProperties IsProduction is equal to False.
If IsProduction Then
Debug.Print "Prod"
Else
Debug.Print "Dev"
End If
Please help!