If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Problem with AutoNumber
My problem is concerning the autonumber
feature...particularly in a table...My tables did have the autonumber feature enabled, then had some corruption with the whole database. I was able to recover the tables and all records, however, the autonumber feature had be changed to number. Since I wasn't able to just change the number field back to autonumber, I went in and filled all the non-sequential records with blank records (ex.: 1,2,4,5 - I put in a 3 with a blank record to fill the void to finish the sequence). Now, I want to put an autonumber field back in to be able to autonumber my tables. Here is the problem...when I add a new autonumber field, it resorts all the blank records to the bottom of the table. Even if I sort ascending. Any suggestions out there? |
#2
|
|||
|
|||
"accessmonk" wrote in
: Here is the problem...when I add a new autonumber field, it resorts all the blank records to the bottom of the table. Even if I sort ascending. Any suggestions out there? You only get sorting when you sort the table... if you sort by a column that has blanks, then those blanks all move to the bottom. To get back to your original problem, the way to convert a LongInteger field back to an Autonumber is this: 1. Back up everything twice... 2. make a new empty table with all the fields as you want them, including substituting the old number field with an AN. 3. append the old table into the new one. Make sure that the old number field gets put into the new AN column -- for example INSERT INTO NewTable (ANCounter, FName, DtOfBirth) SELECT OldIDField, FName, DtOfBirth FROM OldTable This creates an exact copy, with the same numbers in the AN column as you started with. The new AN counter will carry on from the highest value of the OldIDField plus one, as you would expect. 4. Delete all the relationships 5. Rename the old table, rename the new table to the old table name, then recreate the relationships. 6. After fully testing everything, you can delete the old table. Or resort to your backups! Hope that helps Tim F |
#3
|
|||
|
|||
-----Original Message----- "accessmonk" wrote in : Here is the problem...when I add a new autonumber field, it resorts all the blank records to the bottom of the table. Even if I sort ascending. Any suggestions out there? You only get sorting when you sort the table... if you sort by a column that has blanks, then those blanks all move to the bottom. To get back to your original problem, the way to convert a LongInteger field back to an Autonumber is this: 1. Back up everything twice... 2. make a new empty table with all the fields as you want them, including substituting the old number field with an AN. 3. append the old table into the new one. Make sure that the old number field gets put into the new AN column -- for example INSERT INTO NewTable (ANCounter, FName, DtOfBirth) SELECT OldIDField, FName, DtOfBirth FROM OldTable This creates an exact copy, with the same numbers in the AN column as you started with. The new AN counter will carry on from the highest value of the OldIDField plus one, as you would expect. 4. Delete all the relationships 5. Rename the old table, rename the new table to the old table name, then recreate the relationships. 6. After fully testing everything, you can delete the old table. Or resort to your backups! Hope that helps Tim F . That is just what I needed. Worked like a charm. Thanks a million, Tim. |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Multiple Instances problem | Jordan | Using Forms | 1 | July 19th, 2004 03:21 PM |
Big Problem. We need the fix | Captain K | Calendar | 0 | July 8th, 2004 04:50 PM |
Passport Logout Problem | Chen qiang | New Users | 0 | May 4th, 2004 09:26 AM |
Help Microsoft? WORD11.ADM File Problem Line 818? | Dwight Hutchinson | New Users | 2 | May 3rd, 2004 08:25 PM |
Word 2000 footnote problem: footnotes consistently too high (again) | Lori | Formatting Long Documents | 2 | May 1st, 2004 07:15 PM |