Visual Basic Code , VB.NET Code, VB Code
  Home   :  Code   :  Forums   :  Submit   :  Mailing List   :  About   :  Contact


Visual Basic Loan Calculator with Functions


Visual Basic Loan Calculator with Functions

Author
Message
lighthelamp
lighthelamp
Supreme Being
Supreme Being (265 reputation)Supreme Being (265 reputation)Supreme Being (265 reputation)Supreme Being (265 reputation)Supreme Being (265 reputation)Supreme Being (265 reputation)Supreme Being (265 reputation)Supreme Being (265 reputation)Supreme Being (265 reputation)

Group: Forum Members
Posts: 1, Visits: 5
I need to build a Loan Calculator that uses functions to provide the values, for the text boxes, based on what radio button is clicked. Then i need to use a Sub to report the result with a label.



I think i am started off in the right direction but i have no background in vb so please bear with me.





Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

Dim Payment As Double

Dim Nper As Double

Dim LoanIRate As Double

Dim LoanDuration As Integer

Dim LoanAmount As Integer





If rdbmp1.Checked Then

Payment = Pmt(LoanIRate, LoanDuration, -LoanAmount, 0, )

TextBox4.Text = Payment.ToString("#.00")

End If

If rdbamt1.Checked Then

LoanAmount = PV(LoanIRate / 1200, LoanDuration, -Payment)

TextBox1.Text = Payment.ToString("#.00")

End If

If rdbir1.Checked Then

LoanIRate = 1200 * Rate(LoanDuration, Payment - LoanAmount)

TextBox2.Text = Payment.ToString("#.00")

End If

If rdbdl1.Checked Then

LoanDuration = Nper(LoanIRate / 1200, Payment, -LoanAmount)

TextBox3.Text = Payment.ToString("#.00")

End If

End Sub



At the moment the only calculation that is working for me correctly is the monthly payment, all of the others have build errors.
zack
zack
Forum God
Forum God (14K reputation)Forum God (14K reputation)Forum God (14K reputation)Forum God (14K reputation)Forum God (14K reputation)Forum God (14K reputation)Forum God (14K reputation)Forum God (14K reputation)Forum God (14K reputation)

Group: Forum Members
Posts: 102, Visits: 110
Provide the code for your functions.
GO


Similar Topics


Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....

















A1VBCode Forums


Search