Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2004
    Posts
    139

    Unanswered: Display leading zeros in combo box with numeric field

    I have a numeric field that I must use for this application. Customer driven. I can display the leading zeros in other forms by formatting with 00000. However, in this combo box that is pulling the information directly from the table, I set the format to 00000 and it does not display the leading zeros.

    Any suggestions beside change to a text box? Appreciate any help.

    B&R

  2. #2
    Join Date
    Sep 2002
    Location
    South Wales
    Posts
    580

    Question Combo

    Please can you post details of the row source?;

    SQL and number / type of rows.
    Windows Server 2003-8 / Terminal Services / SQL 2000 / Access 2003 / Office 2003-7 / Exchange 2003-7 / Blackberry Enterprise Server / AutoCAD / Lambert And Butler / Red Bull

  3. #3
    Join Date
    Feb 2004
    Posts
    139
    I realized I wasn't totally clear in my question. It will display the leading zeros after I have selected my item from the drop down box. It is the drop down box that displays the numbers just as they are entered in the table. The field is in sql and it is a int field. I am now wondering if I can trick the drop down box by pulling my information from a query versus directly from the table? I might try that.

    Hope I have answered your questions.

    Thanks,
    B&R

  4. #4
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    workaround:

    .rowsource:
    SELECT yourIntField, right$("00000" & yourIntField, 5) FROM yourTable ORDER BY yourIntField
    .columncount: 2
    .boundcolumn: 1
    .columnwidths: 0cm; 3cm

    izy
    currently using SS 2008R2

  5. #5
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Just use the Format function in your combo box's RowSource.

    Format(Fieldname,"00000")
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

Posting Permissions

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