Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2004

    Unanswered: Set number format - 00001

    I have a requirement where I need to store and print numeric data in the following format

    00001 - no decimals

    I need the numeric field data to always be 5 characters - and I also need to increment this field

    ex: 00001 - then 00002 - then 00003 , etc...

    When I create a new field in the table, and set it as a number, it shows 1 , 2 3 , etc...

    How do I set it up to always be 5 characters wide

    Thanks - AB

  2. #2
    Join Date
    Mar 2003
    The Bottom of The Barrel
    Provided Answers: 1
    don't worry about how the data displays when looking at the raw table. Your users should never have access to that anyways. Check out the Format properties on your textbox. set them to 00000.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    As Teddy suggests. Data storage requiremnets are defined in the table, presentation requirements are defined in the presentation layer (forms & reports).

    Access muddies this a bit as:-
    1) you can specify the datatype - if your data is an integer why are you using a decimal data type?
    2) you can specify a format and inout mask (which wuill be pulled through into forms and reports
    3) you can apply formatting in queries using VBA functions such as round() fix() and Int()


  4. #4
    Join Date
    Feb 2004
    Chicago, IL
    I agree. You should save the data as a Long Integer and then display it as the five digit 'number'.

    I would also suggest you use a function that creates the five digit number for every report, form, etc. That way if something changes you don't have to look in more than one place to make the change (when they need to add a sixth digit).

    I would suggest also using something like:

    Right("00000" & lngNumber,5)

    To add the leading zeroes.

Posting Permissions

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