Ok well I'm going to post s/s so you can see my work. I'm very new to this so my code will be far from excellent. As I said before, I got the loop to work but I am not sure how to get my arithmetic right...I believe I have a value that is wrong somewhere or placed in the wrong spot but can't figure it out. I think one of them has to deal with the principle amount because the value should start off at 160,000 and be decreasing but that is not the case.
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Loan, Interest, Years As Single
Dim Numberpayments, Monthlyrate, Monthlypayment As Single
Dim Interestpart, Principlepart, Balance, Principle As Single
Dim Paymentoutput As String
Loan = Val(TextBox1.Text)
Interest = Val(TextBox2.Text)
Years = Val(TextBox3.Text)
Dim count As Single
Numberpayments = Years * 12
Monthlyrate = 1 + (Interest / (12 * 100))
Monthlypayment = (Loan * Interest * Monthlyrate ^ Numberpayments) / (1200 * ((Monthlyrate ^ Numberpayments) - 1))
Interestpart = Principle * (Interest * 0.01) / 12
Principlepart = Monthlypayment - Interestpart
Principle = Loan - Principlepart
Balance = Principle - Principlepart
For count = 1 To Numberpayments
Paymentoutput = Paymentoutput & "Payment #" & count & vbTab & _
Format(Principle, "C") & " " & vbTab & FormatCurrency(Interestpart) & vbTab & _
FormatCurrency(Principlepart) & vbTab & FormatCurrency(Balance) & vbCrLf
Next count
TextBox4.AppendText("Payment Period" & vbTab & "Current Principle" & vbTab & "Interest" & vbTab & "Principle" & vbTab & vbTab & "Balance" & vbNewLine & Paymentoutput)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
TextBox1.Text = Nothing
TextBox2.Text = Nothing
TextBox3.Text = Nothing
TextBox4.Text = Nothing
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
End
End Sub
End Class