Results 1 to 4 of 4
  1. #1
    wasim_sono is offline Advanced Beginner
    Windows XP Access 2013 64bit
    Join Date
    May 2005
    Location
    Pakistan
    Posts
    73

    Customizing the Autonumber field

    Dear All



    I have a table with an autonumber field. This field generates auto numbering like 1,2,3,4,5.... etc.

    I wish to customize this result like B-001, B-002, B-003....etc.

    Is it possible ? If yes then how? Please help me.

    Thanks.

  2. #2
    Join Date
    Sep 2006
    Location
    Manchester, England
    Posts
    13
    The only way to do this is to use a manual primary key which I nearly always try and avoid.

    For your example you would use a text field of length 5 and set it as the primary key.

    You'd then need to write some validation to validate the input of the key and some code to generate the key.

  3. #3
    Yvonneprtrs is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    1
    In the tables auto number field go to format and type: B-000

  4. #4
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    You can't change the Autonumber type field. You should understand what an autonumber is:
    See:

    Autonumbers--What they are NOT and What They Are
    http://www.utteraccess.com/wiki/index.php/Autonumbers

    Microsoft Access Tables: Primary Key Tips and Techniques
    http://www.fmsinc.com/free/newtips/primarykey.asp

    Use Autonumbers properly
    http://access.mvps.org/access/general/gen0025.htm



    But you can create a custom autonumber http://www.baldyweb.com/CustomAutonumber.htm
    (I would still keep the autonumber field type)

Please reply to this thread with any new information or opinions.

Similar Threads

  1. duplicate autonumber
    By rayc in forum Access
    Replies: 5
    Last Post: 06-19-2013, 07:50 AM
  2. Problems with autonumber field in a form
    By admaldo in forum Forms
    Replies: 0
    Last Post: 02-25-2008, 11:09 AM
  3. AUTONUMBER
    By J A F F A in forum Database Design
    Replies: 1
    Last Post: 10-03-2007, 10:30 AM
  4. Quick way to stuff field names into text field
    By kfinpgh in forum Programming
    Replies: 0
    Last Post: 01-04-2007, 01:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums