1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Leading zeros in Access?

Discussion in 'Business Applications' started by Diane Herron, Jan 23, 2002.

Thread Status:
Not open for further replies.
  1. Diane Herron

    Diane Herron Thread Starter

    Joined:
    Dec 28, 2000
    Messages:
    81
    Is it possible to show leading zeros in an autonumber? In other words, we always want the number to be four characters (#1 would look like 0001). Also, how would I show leading zeros in another number that's not an autonumber?

    Thanks for any help!
     
  2. Anne Troy

    Anne Troy

    Joined:
    Feb 14, 1999
    Messages:
    11,746
    First Name:
    Anne
    In design view of the table, click on the autonumber field. At the bottom, in the FORMAT box, type:

    0000
     
  3. curtswanson

    curtswanson

    Joined:
    Jun 22, 2000
    Messages:
    41
    You can set the format for Number type fields by setting the "Format" setting. In Tables, go to Design mode, select the field and choose the desired format. In Queries, Forms and Reports, from Design mode, select the field, right click and choose Properties, find the Format property and enter the format you want.

    There are several default formats - General, Currency, Fixed, Standard, Percent, Scientific but the one you want is a Custom format. It is "00000". Each "0" is a digit placeholder so if your value is 32, the following formats yield the following results:

    "00" 32
    "000" 032
    "00000" 00032
    "000.00" 032.00

    and so on.

    Try looking at the Help menu under Format Property, selecting Number and Currency Data types.
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/65989

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice