Results 1 to 3 of 3
  1. #1
    nishant.dhruve is offline Advanced Beginner
    Windows 7 64bit Access 2013 64bit
    Join Date
    Aug 2016
    Posts
    34

    Auto number generation with specified format

    Hi is it possible to generate autonumber in calendar year form in Table
    for example i want number to be generated something like this based on year

    EU17/0000
    EU17/0001
    EU17/0002

    and when year changes it should change automatic to

    EU18/0000
    EU18/0001


    EU18/0002

    if anyone can help me out on it i would greatly appreciate your efforts on helping me.
    I have attached a sanpshot here. i would like this auto generated number to be plug in the table and it should create a new sequential number as we moved down to new record
    Click image for larger version. 

Name:	MS access.JPG 
Views:	15 
Size:	29.8 KB 
ID:	27831

  2. #2
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    You do not have any control over what Autonumber gets set to. You CAN change the format of it, but not the value.
    So you code "hard-code" the formatting to put "EU17/" in there, though it is NOT really part of the value, so you could not make it start over every year.
    Really, all Auto number should be used for is to ensure a unique value.

    If you have specific rules about some other ID field that you would like to work a certain way, you would probably need to control that with VBA.
    Depending on how your data gets entered into your database (manually through Forms or via imports), would determine how you would run that VBA code (i.e. through the Load event on you Form or via an Update Query after a file import).

  3. #3
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Maybe this link will be useful: http://www.baldyweb.com/CustomAutonumber.htm

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

Similar Threads

  1. Replies: 5
    Last Post: 11-30-2014, 12:46 PM
  2. Number Format to General Format
    By mkc80 in forum Access
    Replies: 2
    Last Post: 05-05-2012, 02:10 AM
  3. Automatic Next number generation
    By MicroMan in forum Programming
    Replies: 17
    Last Post: 10-21-2011, 05:57 PM
  4. Automate Number Generation
    By Kero in forum Access
    Replies: 5
    Last Post: 04-28-2011, 01:49 PM
  5. Correspondence Reference Number Generation
    By ildanach in forum Forms
    Replies: 1
    Last Post: 04-28-2009, 12:09 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