Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Oct 2004
    Location
    Melbourne, Victoria, Australia
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Incorrect autonumber (2002 SP 3)

    I have created a database and one of the tables for some reason has an incorrect autonumber allocated to a record.
    I have no idea how it allocated the wrong number but because of this I need to remember when looking for a record the number will always be different by one.

    For example record 44 is missing and the next record is 45.
    Is there a way of changing record 45 to record 44 and all the way up to record 51?

    I would appreciate any assistance that can be given.

    Thanks

    Norman

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Incorrect autonumber (2002 SP 3)

    If you start to create a record with an autonumber field, then cancel the new record the number that was generated is not used again and so you get a gap in the sequence.
    Generally this does not matter because the numbers used do not carry any meaning and are just there to identify records.

    Autonumbers cannot be changed. If the numbers matter, and you cannot have gaps, it is best not to use autonumbers. Instead you need code to find the current largest number, increase that by one, and insert that in the new record.
    Regards
    John



  3. #3
    New Lounger
    Join Date
    Oct 2004
    Location
    Melbourne, Victoria, Australia
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Incorrect autonumber (2002 SP 3)

    Thank you for your very quick response.
    You described exactly how it occurred only I was not aware of it.

    Thanks I will take your suggestion into consideration.

Posting Permissions

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