Results 1 to 6 of 6
  1. #1
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Combo Box Format (2000)

    I have a combo box showing seven columns (2 text and 5 numeric). This has worked just fine with the numeric values displayed to the second decimal point. I now need to have the numeric values displayed to the fourth decimal. No biggie (or, so I thought). I went to the underlying table upon which the query is built and changed the 'Decimal Places' setting from 2 to 4, ran the query, and viewed the results. Beautiful! Datasheet view reveals the change from 2 to 4 decimal points. The combo (built on that query), however, does not display the change; I'm still only getting 2 decimal points. I've searched help and our site here, but can't seem to locate the appropriate reference.

    As always, any input and/or direction greatly appreciated.
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Combo Box Format (2000)

    I don't know why this happens, but you can get around it by using the Format function in the query:

    F:Format([MyField],"0.0000")

    instead of just MyField.

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Combo Box Format (2000)

    Changing the decimals in the table or query simply means you display the number of decimal places specified in the table or query. It may carry over to a new control placed on a form, but it has nothing to do with what happens in the combobox. A row in a combobox is essentially a string so any formatting you want aside from defaults has to be done using the format function as Hans has suggested.
    Charlotte

  4. #4
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: Combo Box Format (2000)

    Amazing. I don't know how you come up with these answers off the top of your head, but I sure appreciate it. I did notice that I had a circular reference issue when using the same name as the existing "F", no big deal, I just renamed it (as well as the SQL for the combo). Thanks a bunch Hans, and thank you Charlotte for the expansion!
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Combo Box Format (2000)

    Alternatively, you can set the Format property to a custom format with 4 decimals, like 0.0000 or if you want thousands separators too, #,##0.0000

    The Format property is used in the combo box, but the Decimal Places property is ignored.

  6. #6
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: Combo Box Format (2000)

    I had done that with some other combo's, but they were numeric only. As I have two text columns in this combo also, I thought it might cause some problems and discounted it without further consideration. At any rate, your original solution works great. I will, however, try the later solution later to see what effect it has on the text/numeric display and post back here with the results. Thanks again!
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

Posting Permissions

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