Read Only

It is very common to have read-only properties but not write-only.
A large number of the properties are typically read-only.


This property only has a Property Get (no Property Let) which means that it is read-only.

Public Property Get NormalHours() As Double 
   NormalHours = mdbNormalHours
End Property

This property only has a Property Get (no Property Let) which means that it is read-only.

Public Property Get OvertimeHours() As Double 
   OvertimeHours = mdbOvertimeHours
End Property

A lot of the object model classes contain a lot of properties that cannot be set.
If a property cannot be set, it is read-only as opposed to read-write).
Many properties have built in constants that should be used for their values.


Using a Function Instead

You can create functions that can be treated like a read-only property




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