Results 1 to 3 of 3

Thread: Autonumbers with extensions

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Location
    Bolton, England
    Posts
    2

    Post

    How do I create an autonumber command for Access 97 that creates a sequential number following the following format:

    p00/nn. where 00 is the year created?

    I'm using the RND() command at the moment in the following construct:

    ="p" YEAR(NOW())"/"rnd(1-99)

    Which returns a value of P2000/nn.

    So I would like to condense the YEAR(NOW()) to return only the last two digits of the year.

    Also the rnd statement returns a random number between 1 and 99, which is fine for my purposes, but it would be better if it could be made to return the next unused number in the sequence.

    Any ideas?

    Thanks

    ------------------
    Ron Heywood

  2. #2
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post

    Looks like you'll have to enforce this via code, not via Access autonumber rules...Access doesn't have anything like a trigger to do this for you

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Location
    Bolton, England
    Posts
    2

    Post

    It'll have to be done in the form of a query generated output anyway I assume, because we need to get the last number and increment it by one, but leave the year as Now() trimmed to the "yy" format.

    SQL looks like the next step unless anyone has any better ideas.

    Thanks for your help.

Posting Permissions

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



Click Here to Expand Forum to Full Width