I am having trouble with starting an if statement to make an amortization schedule show up in a textbox. I have the amount, and interest, and payment and stuff. Now I just need to create an amortization schedule and display it in a text box.
Here is a picture and then the code to help you guys help me.

CODE
Private Sub btncalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btncalculate.Click
Dim dblamountofloan As Double
Dim dblrate As Double
Dim intmonths As Integer
Dim dblpayamount As Double
Dim line As String
dblamountofloan = Convert.ToDouble(txtamount.Text)
dblrate = Convert.ToDouble(txtintrate.Text)
intmonths = Convert.ToInt32(txtmonths.Text)
dblpayamount = (dblamountofloan * (dblrate / 12)) / (1 - 1 / (1 + dblrate / 12) ^ intmonths)
txtpayment.Text = dblpayamount.ToString("C")
If intmonths <= 12 Then
txtline.text = line & "Month" & vbTab & "Payment" & vbTab & "Interest" & vbTab & (txtline.text)
End If
End Sub
Private Sub btnclear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnclear.Click
txtamount.Clear()
txtintrate.Clear()
txtmonths.Clear()
txtpayment.Clear()
txttable.Clear()
This post has been edited by sooperman: 4 Apr, 2008 - 04:39 PM