Listing Loan Object Implementation Details

Public Property Get Principa1Amount() As Variant

PrincipalAmount = mvPrincipalAmount End Property

Public Property Let Principa1Amount(ByVa1 vNewValue As Variant)

mvPrincipalAmount = vNewValue End Property

Public Property Get InterestRate() As Variant

InterestRate = mvlnterestRate End Property

Public Property Let InterestRate(ByVa1 vNewValue As Variant)

mvlnterestRate = vNewValue End Property

Public Property Get LoanNumber() As Variant

LoanNumber = mvLoanNumber End Property

Public Property Let LoanNumber(ByVa1 vNewValue As Variant) mvLoanNumber = vNewValue

End Property

Public Property Get Term() As Variant

Term = mvTerm End Property

Public Property Let Term(ByVal vNewValue As Variant)

mvTerm = vNewValue End Property

Public Property Get Payment() As Variant

Payment = Application.WorksheetFunction.Pmt _

(mvInterestRate / 12, mvTerm, -mvPrincipalAmount) End Property

As you can see, using Property procedures is a little more work, but not much, considering you can now implement read/write, read-only, or write-only procedures. Plus, you can perform data validation on any incoming values before you officially accept the value by assigning it to the private modulelevel variable created to store the value.

0 0

Post a comment