VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Simple loan calculator

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

Rate 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


Download this snippet    Add to My Saved Code

Simple loan calculator Comments

No comments have been posted about Simple loan calculator. Why not be the first to post a comment about Simple loan calculator.

Post your comment

Subject:
Message:
0/1000 characters