Property Get

used to retrieve a property of a class.


This is exactly the same as just using a private variable.

Public Property Get Property_Department() As String 
   Property_Department = field_sDepartment
End Property

The following line gets the department by calling the property Get procedure

Call MsgBox(oEmployee.Property_Department) 

Public Property Get Property_HoursPerWeek() As Double 
   Property_HoursPerWeek = field_dbNormalHours + field_dbOvertimeHours
End Property

Returns a property object reference

Public Property Get Property_SomeThing() As Object 
   Set Property_SomeThing = field_oObject
End Property


© 2022 Better Solutions Limited. All Rights Reserved. © 2022 Better Solutions Limited TopPrevNext