Property Definition

Syntax
[ | Private | Public | Friend ] _
[ Default ] _
Property Get name[type][([param[, ...]])] [As type[()]]
    statements
End Property
-or-
[ | Private | Public | Friend ] _
[ Default ] _
Property [Let|Set] name[([param[, ...]])]
    statements
End Property
Group
Declaration
Description
User defined property. The property defines a set of statements to be executed when its value is used or changed. A property acts like a variable, except that getting its value calls Property Get and changing its value calls Property Let (or Property Set). Property Get and Property Let with the same name define a property that holds a value. Property Get and Property Set with the same name define a property that holds an object reference. The values of the calling arglist are assigned to the params. (For Property Let and Property Set the last parameter is the value on the right hand side of the assignment operator.)
Access
If no access is specified then Public is assumed.
See Also
Function, Sub

Dim X_Value
 
Property Get X()
    X = X_Value
End Property
 
Property Let X(NewValue)
    If Not IsNull(NewValue) Then X_Value = NewValue
End Property
 
Sub Main
    X = "Hello"
    Debug.Print X '"Hello"
    X = Null
    Debug.Print X
End Sub