Results 1 to 5 of 5

Thread: Format(, "Currency") does not work

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2001
    Location
    Los Angeles, CA
    Posts
    12

    Unhappy

    i have this code in my program
    lblAnswer.Caption = Format(sngAmount, "Currency")

    when i run it i get this error:
    can't find project or library

    am i missing a reference or something? if so what?

    please help

  2. #2
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    Works form me. What version are you running. Here's the code I used
    Code:
    Private Sub Command2_Click()
        Dim sngAmount As Single
        sngAmount = 350.6
        lblAnswer.Caption = Format(sngAmount, "Currency")
    End Sub

  3. #3
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    Maybe your having a version conflict, try this piece of code instead.
    Code:
    Private Sub Command2_Click()
        Dim sngAmount As Single
        sngAmount = 350.6
        lblAnswer.Caption = FormatCurrency(sngAmount)
    End Sub

  4. #4

    Thread Starter
    New Member
    Join Date
    Mar 2001
    Location
    Los Angeles, CA
    Posts
    12

    Talking

    Thanks alot!!!!

    lblAnswer.Caption = FormatCurrency(sngAmount)
    is the one that worked. I am using vb6 professional. and the books that i am learning from are for vb6 any clue on why there is a conflict?

    thanks

  5. #5
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    I'm using the enterprise edition, so I can't test the code on the professional version, but I can't see why it wouldn't work on that Version??

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