Results 1 to 3 of 3

Thread: Autonumber

  1. #1
    Join Date
    Dec 2004
    Posts
    12

    Unanswered: Autonumber

    somebody know how to get the sequence of number after delete data?

    i use autonumber for data in table.when one of data deleted, i want the other data sort by sequence number.so what must i do?there are need to use script?if yes,how to use it because i don't know how to use the data script.

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    What's a sequence number?

    If you're talking about changing primary keys on a table because you don't want a gap, I would strongly, STRONGLY advise against doing this.
    Last edited by Teddy; 01-06-05 at 10:59.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    Nov 2004
    Location
    Bangor, ME USA
    Posts
    44
    If I understand what you mean, it goes something like this:

    you have a table for which there is an autonumber, say (record_ID) and it is used as a primary key, and possibly related to other tables. When you delete a record, or a record is added but not saved there are gaps in your numbering and you want to fix this.

    to just sort on the current sequence just press the sort ascending button on the tool bar to accomplish that portion.

    To find the missing numbers only check out:

    http://www.rogersaccesslibrary.com/Otherdownload.asp?SampleName='Gap%20Finder%20(GapF inder.mdb)'

    change the autonumber to a straight numeric, Long Integer and you can assign the missing numbers yourself instead of it assigning it for you.

    To fix gaps however - ther is a way, you may have to change the filename in code but check outthis zipped file that will show how to reclaim the skipped numbers first then continue. The program was developed by Neil Squires and should work. It does not in my project yet but it would show how to do it or give others ideas.

    HTH
    Kevin
    Attached Files Attached Files

Posting Permissions

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