Results 1 to 3 of 3

Thread: Listbox dataformat

  1. #1
    Guest
    I'am populating a Listbox and Datalist with prices from an Access database.
    My problem is that I cannot get the prices to display in the currency format.
    I have set the DataFormat Property to Currency but this has no affect.
    I have populated the Listbox using a data control and with code just to check to see one way would work better than the other, but I can't display the currency correctly no matter which way I try.

    Here is the code I used.

    Do While Not Records.EOF
    Price.AddItem Records("Price")
    Price.ItemData(In_Stock.NewIndex) = Records("Stock_Code")
    Records.MoveNext
    Loop

    Can any one help!!!

  2. #2
    Guest
    You can try a couple of things:

    Price.AddItem CCur(Records("Price") ) or

    dim curPrice as Currency
    curPrice = Format(Records("Price"), "###,###.##")
    Price.AddItem curPrice

  3. #3
    Guest
    I have tried both your suggestions without any success.

    The second option rounded down the values for example
    Correct amount 1.55
    Amount Displayed 1.5

    Also the currency sign was not included
    £1.55

    I feel as though the things I have tried and your suggestions should work, but I might be missing something else.

    Any Further Suggestions
    Thanks

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