Results 1 to 5 of 5
  1. #1
    Lounger
    Join Date
    Dec 2000
    Location
    Nebraska
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Sequence numbers (97 SR2 or 2K)

    I want to revise a purchase order application to use a sequence number as a major part of the identification code. I know that I should not use an autonumber field for this, but I can

  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Sequence numbers (97 SR2 or 2K)

    When I do a custom counter, I don't assign the number until the last step of my form's BeforeUpdate event. Then I use code like this:

    txtCounter = DMax("Counter","sometable")+1

    This finds the current highest value then adds one to it. It is possible that 2 users can ask for the DMax at the same time (but not likely). And if that does happen, one will get a error message and merely has to try again.

    This method eliminates gaps (unless you delete a record). I don't know how to "reserve" a space, however, without actually writing a record to it.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  3. #3
    Lounger
    Join Date
    Dec 2000
    Location
    Nebraska
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Sequence numbers (97 SR2 or 2K)

    O.K., Mark. That looks like a straight-forward way to handle it. Guess I'll just try it and see what I run into. Thanks for your help.

    Paul

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Sequence numbers (97 SR2 or 2K)

    It isn't logical to "reserve" a number for future use. If what you're creating is sequence numbers, then logically they have to be created in order. Don't make extra work for yourself.
    Charlotte

  5. #5
    Lounger
    Join Date
    Dec 2000
    Location
    Nebraska
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Sequence numbers (97 SR2 or 2K)

    Thanks, Charlotte, but it has to be done. Accommodating existing employees and an existing system, that's the way it is. Besides, it does work.

    Paul

Posting Permissions

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