Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2008

    Unanswered: Access 2003, generating ID codes -autonumber?

    how do I generate product codes that automatically detects the current year and can do auto-letters? specifically:

    (YY)-(#####)-(A) : where YY is the last two digits of the current year, ##### is an autonumber that starts from 00001. Oh, and I can't seem to make it display zeroes before an integer. ...and A is an ...uhm "auto letter" that starts from letter A and ends with Z

    Is it possible for access to generate it automatically whenever I add a new entry? I'm manually inputting every code at the moment.

    Last edited by coffeecat; 06-24-08 at 02:25.

  2. #2
    Join Date
    Nov 2007
    Adelaide, South Australia
    Access can certainly do it... It's probably best to calculate it though. Just using an Autonumber and a Date/Time field for the date... you could use an expression to generate it.

    =Format(DateField,"yy") & Format(AutonumberField, "00000") & "A"

    Not quite sure about the autoletter thing though :/

    Why do you need the "autoletter"?
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!

    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  3. #3
    Join Date
    Jun 2008
    Thanks for the help, give me a while to figure out how to use expressions and I'll let you know how it went. =D

    The letters are for a different code, I just added the question here. It works as a variant code; Type A, Type B, etc. It helps us keep track of variations. -and yes, its a laziness kind of thing. LOL

  4. #4
    Join Date
    Jun 2008
    Thanks again.

    anyway, I learned that pasting this in the format for autonumber also works when adding zeroes before an interger:


Posting Permissions

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