Results 1 to 4 of 4
  1. #1
    Acc4me is offline Novice
    Windows 7 Access 2007
    Join Date
    Nov 2009
    Posts
    9

    Please help with Access issue

    Example 1:



    2011-1
    .......

    2011-3893 etc.

    Currently I have an Access form which produces a new unique number to identify each new record created. To do this I use the unique ID autonumber from a table to identify the new records. I would like to change from this simple number to the the above format per example 1. The four digits to the left of the hyphen would always be the current year and digits to the right of the hyphen would be the unique auto incrementing numbers such as from my table. I need the year to auto increment by 1 each September 30th (new business year) and I need the numbers to the right to auto reset to 1 to start uniquely identifying records again for the new incremented year. As each record is closed I need the number to be written as a single entity in the new format to my database.

    Any help will be much appreciated.

    Example 2: After September 30th.

    2012-1
    .......

    2012-447 etc.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    Here is how I do it http://forums.aspfree.com/microsoft-...ta-403208.html

    You will have to modify for the sequence to reinitiate October 1 instead of January. That will definitely be more complicated.

    To enable proper sorting/filtering of the ID, should use placeholder 0's, like 2011-0001. Construct the ID to allow for maximum value. 9999 is more than enough for our needs. We haven't yet hit 4000 in one year.
    Last edited by June7; 09-25-2011 at 01:29 PM.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Acc4me is offline Novice
    Windows 7 Access 2007
    Join Date
    Nov 2009
    Posts
    9
    June7,

    Thanks for taking the time to address my issue. I am new at VB programming but, I am working hard to learn. I will have to figure out how to change to September 30th.

    Treypick

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    The string manipulation techniques I show will be much the same. It is date criteria that can be tricky. All an exercise in logic and this should be a good one to learn from. Post your attempt for analysis.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Complex issue in MS access
    By ganeshvenkatram in forum Access
    Replies: 6
    Last Post: 06-14-2011, 11:22 PM
  2. Query Issue in MS-Access
    By nrsanand in forum Queries
    Replies: 1
    Last Post: 02-15-2011, 01:34 PM
  3. Access opening issue
    By tmcrouse in forum Database Design
    Replies: 1
    Last Post: 07-23-2010, 08:06 PM
  4. Keep together issue (Access 12)
    By alpha in forum Reports
    Replies: 2
    Last Post: 06-02-2009, 08:21 AM
  5. Access Issue
    By uk in forum Access
    Replies: 0
    Last Post: 07-04-2007, 09:08 AM

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