Results 1 to 3 of 3

Thread: The Dreaded PMT Function

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2001
    Location
    MD
    Posts
    2

    Cool The Dreaded PMT Function

    Hi. Yes, another newbie here. I'm in my third semester of College working for Networking/Programming degree. Of of my current programming classes is VB 6.0. I have already written 3 programs that do various calculations using the Val function.

    Although we didn't discuss the PMT function in class, my teacher asked us to write a program that would calculate the total interest of a loan, and total amount owed. The VB version I'm using came with the book we're using and doesn't have a Help file. Therefore, I looked at the PMT function in Excel, assuming it should be similar.

    I have worked on this for more hours than I'd care to admit, and I keep getting different errors. I know this will probably end up being an easy fix, but can someone please look at my code and let me know what you think?

    Here is my code under the Calculate command button. Could anyway tell me if I’m at least CLOSE? Any help would be appreciated. Thanks in advance. Here’s the code:

    Private Sub cmdCalc_Click()
    Dim sngRate As Single
    Dim sngTerm As Integer
    Dim sngAmtloan As Single
    Dim sngTotOwed As Single

    sngRate = Val(txtRate.Text)
    sngTerm = Val(txtTerm.Text)
    sngAmtloan = Val(txtAmtloan.Text)
    sngTotOwed = Val(lblTotOwed.Caption)

    sngTotOwed Pmt=(txtRate.Text / 12, txtTerm.Text * 12, -txtAmtloan.Text)

    End Sub

  2. #2
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    You can get the whole MSDN shebang at msdn.microsoft.com

    The PMT function is detailed here http://msdn.microsoft.com/library/de.../D6/S5B285.asp

    There's also an example at the end

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2001
    Location
    MD
    Posts
    2

    Thumbs up MSDN

    Thanks for the response man! I'll check that out.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width