Results 1 to 3 of 3

Thread: Auto Numbers

  1. #1
    Join Date
    Oct 2014
    Posts
    1

    Unanswered: Auto Numbers

    Dear All

    I will be very grateful if anyone can help me to create auto numbers as described below, keep in mind I'm new to using access.

    I am attempting to set up the auto number based on the input date along with a sequence number.

    The Auto Number should take the date from UNPUT DATE, Basically the format would be year, month, day and increment (starting at 001)

    YYDDMM-Seq.No

    141013-001
    141013-002
    141013-003

    etc

    Next day the Sequence Number should change according to date and reset the increment to start again at 001

    141014-001
    141014-002

    etc

    I do realize that it needs some efforts to get the desired results for which I would like to Thank in advance for any help / suggestions.

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    there's lots of answers to this sort of problem, already on this forum. If you do a search you should find what you need
    but in essence what you need is a function which returns the next available number
    you can find the current highest number using the domain funstion DMAX
    the only issue is if you are using a multi user db where there could be more than one user trying to insert a row at the same time. if that is so either secure a table lock whilst you get the next number OR put in error trapping that gets another number if the insert fails becuase of a duplicate index error
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    495
    Provided Answers: 24
    You cant really autonumber this. You'd need a custom function to count the ones already there, then add 1 to it.

Tags for this Thread

Posting Permissions

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