Formatting numbers in combo-boxes - basic.visual

This is a discussion on Formatting numbers in combo-boxes - basic.visual ; Hello NG! Being a newbee to VB6.0, I'm faced withe the following problem: I'm using VB6.0 on WinXP Pro to re-engineer a DB-frontend. There a several frames containing combos based on fixed lists of values. This, I like to change ...

+ Reply to Thread
Results 1 to 2 of 2

Formatting numbers in combo-boxes

  1. Default Formatting numbers in combo-boxes

    Hello NG!

    Being a newbee to VB6.0, I'm faced withe the following problem:
    I'm using VB6.0 on WinXP Pro to re-engineer a DB-frontend.
    There a several frames containing combos based on fixed lists of
    values.
    This, I like to change to combos, whose lists are derived from
    database-tables.

    Having succeeded in doing so, I now have to cope the fact, that the
    format of the values is lost
    Within the table (Access '79) the format is "#.##0" (european number-
    format, no digits after comma, dot separates the thousands)
    Exactly the same format would be appreciated in the VB-form

    But since ' combobox1.DataFormat.Format = "#.##0" ' or '
    combobox1.DataFormat.Format = "#,##0" ' doesn't work, I'm totally at a
    loss.


    Any help will be appreciated!
    Alex


  2. Default Re: Formatting numbers in combo-boxes

    Found the solution with the aid of a friend.
    If anyone else stumbles at this point:
    With the use of FormatNumber(...), you can format the item before
    adding it to the combobox-list

    cmb_1.AddItem (FormatNumber(rsI!SB_Euro, 0, vbUseDefault,
    vbUseDefault, vbUseDefault))


    A.S.

    On 16 Mrz., 15:11, "Alex Sauer" <dead.man.walk...@gmx.de> wrote:
    > Hello NG!
    >
    > Being a newbee to VB6.0, I'm faced withe the following problem:
    > I'm using VB6.0 on WinXP Pro to re-engineer a DB-frontend.
    > There a several frames containing combos based on fixed lists of
    > values.
    > This, I like to change to combos, whose lists are derived from
    > database-tables.
    >
    > Having succeeded in doing so, I now have to cope the fact, that the
    > format of the values is lost
    > Within the table (Access '79) the format is "#.##0" (european number-
    > format, no digits after comma, dot separates the thousands)
    > Exactly the same format would be appreciated in the VB-form
    >
    > But since ' combobox1.DataFormat.Format = "#.##0" ' or '
    > combobox1.DataFormat.Format = "#,##0" ' doesn't work, I'm totally at a
    > loss.
    >
    > Any help will be appreciated!
    > Alex




+ Reply to Thread

Similar Threads

  1. Combo Boxes
    By Application Development in forum ADO DAO RDO RDS
    Replies: 14
    Last Post: 12-11-2007, 11:08 AM
  2. help with combo boxes
    By Application Development in forum Adobe Acrobat
    Replies: 0
    Last Post: 01-14-2007, 08:05 PM
  3. Combo Boxes Need a bit of help
    By Application Development in forum basic.visual
    Replies: 2
    Last Post: 06-02-2005, 07:43 PM
  4. Populate Combo Boxes
    By Application Development in forum basic.visual
    Replies: 1
    Last Post: 01-01-2004, 04:40 AM
  5. combo boxes
    By Application Development in forum basic.visual
    Replies: 0
    Last Post: 08-26-2003, 09:29 PM