Mortgage Calc Help. Not sure what I am doing wrong?

Deal Score0

I have my code, but I am getting an error. Can anyone help please? My error is: “Error 1 ‘lstLoanInterest’ is not declared. I am unsure of how to write this out. Maybe a string?

Private Sub CalculateButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CalculateButton.Click
‘Calculate the Monthly Payment’
Dim dblAmount, dblMonthlyRate, dblMonths, dblMonthlyPayment As Double
‘Convert input values to numeric values’
dblAmount = CDbl(LoanAmount.Text)
dblMonthlyRate = CDbl(InterestRate.Text) / 100 ‘allows interest rate to be entered whole number’
dblMonths = CDbl(Years.Text)
‘Format input values’
LoanAmount.Text = FormatCurrency(dblAmount)
InterestRate.Text = FormatPercent(dblMonthlyRate)
Years.Text = FormatNumber(dblMonths)
‘Calculate payment’
‘Results for listbox should be new loan balance and interest rate’
Dim PVal, FVal, mPayments As Integer
Dim APR, iPayment, TotInt As Double
Dim pPayment, TotPrincipal, dblBalance As Double
PVal = dblAmount
FVal = 0
APR = dblMonthlyRate / 12
mPayments = dblMonths * 12
dblBalance = dblAmount
For period As Integer = 1 To mPayments
iPayment = IPmt(APR, period, mPayments, -PVal, FVal, 1)
pPayment = PPmt(APR, period, mPayments, -PVal, FVal, 1)
lstLoanInterest.Items.Add(FormatCurrency(TotPrincipal).PadRight(25) & FormatCurrency(iPayment).PadRight(25) & FormatCurrency(dblBalance).PadLeft(25))
Debug.WriteLine(” Pmnt #” & period & ” -> Principle =” & FormatCurrency(TotPrincipal).PadRight(14) & ” Int Paid for Payment #” & period & ” is ” & FormatCurrency(iPayment) & ” Bal. =” & FormatCurrency(dblBalance))
TotInt = TotInt + iPayment
TotPrincipal = TotPrincipal + pPayment
Dim monthlyPayment As Double = CDbl(iPayment + pPayment)
dblBalance = dblBalance – (monthlyPayment – iPayment)
lstLoanInterest.Items.Add(” _______________________________”)
lstLoanInterest.Items.Add(” Total interest paid: ” & FormatCurrency(TotInt))
lstLoanInterest.Items.Add(” _______________________________”)
lstLoanInterest.Items.Add(” Total Paid after: ” & mPayments & ” Payments = ” & FormatCurrency(TotInt + TotPrincipal))
lstLoanInterest.Items.Add(” _______________________________”)
lstLoanInterest.Items.Add(” Last Payment is an interest payment of course, and it is ” & FormatCurrency(iPayment))
‘Format answer’
dblMonthlyPayment = CDbl(iPayment + pPayment)
PaymentLabel.Text = FormatCurrency(dblMonthlyPayment)
End Sub
I am trying to list the amortization table for the mortgage.

Ok, so my hubby’s DTI ratio is 35%. This is without a mortgage payment (darn car payment and student loans) (we are trying to get a house). Does our new mortgage payment need to be calculated with this number? Will a lender look at that and say the ratio is too high to qualify for a mortgage?
can you please explain to me how they look at this? We’re trying to get FHA in Pennsylvania.

  1. Reply
    February 3, 2011 at 5:27 pm

    What exactly is lstLoanInterest suppose to be, because you don’t have it declared. If it is supposed to be a string, then someplace you need to declare it before you attempt to use it. I first assumed that it was a list of some type based on the lst prefix, and the items.add syntax.

    Edit: I know you are trying to list the mortgage payments however you probably want to take a look at StringBuilder.

  2. Reply
    February 3, 2011 at 5:36 pm

    You can’t access the “add” method of the list before you declare it:

    lstLoanInterest.Items.Add() will fail because lstLoanInterest isn’t declared yet

    You need to declare the list:

    Dim lstLoanInterest As New ListItemCollection

    before you can add anything to it.

  3. Reply
    February 3, 2011 at 6:30 pm

    Up until about 8 years ago, lenders required that your total debt to income could not exceed 36% of your gross monthly income and that includes your mortgage. Sub prime lending came along and increased the dti to 50%. FhA is making alot of drastic changes at this point in order to give people a chance to refinance or purchase new homes. Your best bet is to arrange a meeting with an FHA approved lender to get the latest news of the changes. You can find these lenders in your yellow pages. Words of wisdom: Do not go more than 40% of your gross income into debt.

  4. Reply
    Michael C
    February 3, 2011 at 6:48 pm

    They will look at all payments due, and the proposed mortgage payment. This is called your “back ratio” It may not be too high depending on the purchase price of the house.
    We have done FHA loans with back ratios as high as 56.
    Also depending on where in PA you live, check out USDA loans. 102% financing, no mi. Also, if you have income, that can be included also, to lower the total ratio.

    Leave a reply

    Register New Account
    Reset Password