Hi everyone, I have been trying to do the funtion but just could not seem to get it to work, can someone please take a look at it and tell me what is wrong with my entry?
If bValidEntries = True Then
dMonthlyInvestmet = txtMonthlyInvestment.Text
dYearlyInterestRate = txtYearlyInterestRate.Text
iNoOfYears = txtNoOfYears.Text
iNoOfMonths = iNoOfYears * 12
dMonthlyInterestRate = dYearlyInterestRate / 12 / 100
iKount = 1
lblFutureValue.Text = FormatCurrency(FutureValue _ (dMonthlyInvestmet, dMonthlyInterestRate))
End If
AND MY PRIVATE FUNCTION CODE IS
Private Function FutureVal( _
ByVal dMI As Decimal, _
ByVal dYIR As Decimal, _
ByVal iNOM As Integer, _
ByVal iCount As Integer, _
ByVal dMIR As Decimal, _
ByVal iNOY As Integer) As Decimal
Dim dFutureVal As Decimal
iNOM = iNOY * 12
dMIR = dYIR / 12 / 100
For iCount = 1 To iNOM
dFutureVal = (dFutureVal + dMI) * (1 + dMIR)
Next
Return dFutureVal
I really do not know where is my error and hopefully you will be able to let me know. Thanks