by Vicky Jadhav (Vj) (8 Submissions)
Category: Math/Dates
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Tue 12th October 2004
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Simple loan calculator
Text = 48
and Now you place One Check Box.
Name = PayEarly
Caption = Check if early payments
and you Place Two Command Button
Command1 : Name = ShowPayment
Caption = Show Payment
Now If Front of this Command Place One More Text Box
and In Front Of this Place second Command Button
Command2 : Name =bttnExit
Caption =EXIT
Private Sub bttnExit_Click()
End
End Sub
Private Sub ShowPayment_Click()
Dim Payment As Single
Dim LoanIRate As Single
Dim LoanDuration As Integer
Dim LoanAmount As Integer
If IsNumeric(Amount.Text) Then
LoanAmount = Amount.Text
Else
MsgBox "Please enter a valid amount"
Exit Sub
End If
If IsNumeric(IRate.Text) Then
LoanIRate = 0.01 * IRate.Text / 12
Else
MsgBox "Invalid interest rate, please re-enter"
Exit Sub
End If
If IsNumeric(Duration.Text) Then
LoanDuration = Duration.Text
Else
MsgBox "Please specify the loan's duration as a number of months"
Exit Sub
End If
Payment = Pmt(LoanIRate, LoanDuration, -LoanAmount, 0, PayEarly.Value)
txtPmt.Text = Format$(Payment, "#.00")
End Sub