Property Get

used to retrieve a property of a class.

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

Public Property Get Department() As String 
   Department = msDepartment
End Property

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

Call MsgBox(objEmployee.Department) 

Public Property Get HoursPerWeek() As Double 
   HoursPerWeek = mdbNormalHours + mdbOvertimeHours
End Property

Returns a property object reference

Public Property Get SomeThing() As Object 
   Set SomeThing = m_objObject
End Property

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