I have been trying to increase the autonum number (jump forward) and used the instructions provided in the help. Though, whenever I complete the tasks of deleting the record and re-setting the validation rules/relationships etc., the starting autonum is not where I want it to be (1 after the appended number). What is the correct way to do this? I have tried to un-split, run the append query, and then split again, but to no avail
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Autonum change in linked table (Access97)
Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Autonum change in linked table (Access97)
- This topic has 19 replies, 6 voices, and was last updated 23 years, 8 months ago.
AuthorTopicWSalpi
AskWoody LoungerAugust 9, 2001 at 5:43 pm #358945Viewing 0 reply threadsAuthorReplies-
WSMarkLiquorman
AskWoody LoungerAugust 10, 2001 at 12:28 pm #536898I don’t know why you are changing validation rules and relationships. All you need to do is run the append query. New autonumbers will then pick-up after the number. New autonumbers will then pick-up after that new number. Don’t delete the dummy record created by the append and don’t compact the database until you have entered some new valid records.
-
WSalpi
AskWoody Lounger -
WSCaz
AskWoody LoungerAugust 10, 2001 at 5:34 pm #536945Bad choice to use the autonumber as a key field or as a join field as the autonumber can reset on compact, restore etc… You will have great difficulties continuing with autonumber as is.
If you want to continue as you are then the only thing I can think of is to put a dummy record in with the autonumber set to one before the number you want then delete the dummy record. The autonumbering may then continue from the number you want.
My choice would be to recreate the table with the current autonumber set as just a number field, append your data into it, and put the code into the database to create the number sequencing for you.
It is bad practice to create a Primary Key on an autonumber field, it nearly always ends in problems when you need to restore data especially when rows have been deleted as it will re-number your records.
-
WSMarkLiquorman
AskWoody LoungerAugust 10, 2001 at 8:09 pm #536972>>It is bad practice to create a Primary Key on an autonumber field, it nearly always ends in problems when you need to restore data especially when rows have been deleted as it will re-number your records.<<
Do you mean it will renumber existing records? I have never seen that before. An autonumber is generally a perfect choice for a PrimaryKey since it can not be changed.
-
WSChuck Tucker
AskWoody LoungerAugust 12, 2001 at 9:01 pm #537074Mar,
I did not see any response to your question regarding the use of Autonumber fields as primary keys, and I am MOST curious about it. I agree with your comment that Autonumbered fields are a perfect choice for a Primary Key. If not, then I’m going to have a horrendous mess some time in the not too distant future!
Have you heard anything more about this? It is my understanding that autonumber will not renumber the records when some are deleted or compressed or repaired. I sure hope that is the case.
-
WSMarkLiquorman
AskWoody LoungerAugust 12, 2001 at 9:32 pm #537075>>then I’m going to have a horrendous mess some time in the not too distant future!<<
Chuck,
You and me both! I haven't heard any more about this, but I figured it might be because of the weekend. However, since I've never heard that comment anywhere before, I'm not too worried. I'm guessing we misinterpreted the statement, and it perhaps had to do with adding an autonumber field to a record.
-
WSbushaw
AskWoody LoungerAugust 13, 2001 at 3:18 pm #537143I agree that an autonumber field is a great choice for a primary key. However, I’ve encountered “challenges” with using autoumber primary key fields in the following situation: When I archive records from my “active” table to an “archive” table, I’d like the primary key (the autonumber field) to remain unique across all records in both tables (since it provides the relationship to various other tables). However, once a particular autonumber value is gone from the “active” table, a new record added may be given this value, thus duplicating a primary key in the “archive” table. To avoid this, (based on advice from Charlotte here in Woody’s Lounge), I set up a “master” list of if IDs that are autonumbered. They then relate to an ID field in both the archive and active tables which are not autonumbered. This adds some overhead when adding and deleting records (adding a record to the active table means adding a new record to the master list (with a new and unique-across-both-tables autonumber primary key ID), then actually adding the new record in the active table and copying the master list autonumber value into the field that’s related to the master list ID). Deleting records can be taken care of through referential integrity. It seems like there ought to be a less cumbersome way of doing this — is there???
Regardless, even with this sort of arrangement, I’ve never seen autonumber fields getting re-numbered. Boy, would that be a mess!
Tom
-
WSMarkLiquorman
AskWoody LoungerAugust 13, 2001 at 6:35 pm #537162Well, you could set-up your autonumber to create a random number rather than a sequential one. The odds that you would re-use an autonumber is very small. This is what is used in replicated databases.
If you never archive the most recent active record (that is, with the highest autonumber) then even a sequential autonumber should not duplicate. Even after a compact, the next autonumber assigned will be 1 more than the current highest number. You could aways do a DLookup to see if it was in archive table.
-
WSbushaw
AskWoody LoungerAugust 13, 2001 at 8:00 pm #537181I, too, thought the autonumber-increment method would use the next higher number. But I found duplicates appearing (as described in my previous post) — the newer records were being assigned “old” (archived) numbers even though there were higher active autonumbers — the autonumbering scheme seemed to be “filling holes”. I’ll have to admit that I wasn’t too diligent about repairing/compacting after archiving (removing records from the active table) — that may be part of the problem. Also, and this may be circumstantial, I noticed this problem only after upgrading from Access 97 to 2000.
Autonumber-random is a good idea. With the odds of duplicating an existing record at around 1 in 4 billion, I guess it’s pretty safe (unless you’ve got a fairly big database!). If I were to worry about such odds, I should be buying a lot more Lotto tickets!
-
WScharlotte
AskWoody LoungerAugust 14, 2001 at 12:25 am #537226What you’re describing has always existed with autonumbers, and it’s really more an issue of the way you’re archiving than a problem with autonumbers.
If you delete records (either after archiving or for any other reason), a compact will reset the next sequential autonumber to the next number after the highest autonumber left in the table. If you delete *all* the records, the next highest number is 1, and you would have to keep a “seed” record in the table to avoid stepping on archived numbers. However, a simpler remedy is to have an additional field that will work with the autonumber to provide a unique key, even if the autonumbers are the same.
-
WSMarkLiquorman
AskWoody Lounger -
WScharlotte
AskWoody LoungerAugust 14, 2001 at 5:38 am #537256SR-1 fixed a problem that occurred when you appended records with existing keys to a table with an autonumber field. The next time you tried to add a record the normal way, it would attempt to use the next largest number based on what was in the table before you appended records.
Access has always reset the autonumber on compact so that the next value will be one higher than the highest existing autonumber in the table. Before SR-1, that was broken in Access 2000, but only when you had appended records with autonumber keys to the table. If you added records the usual way, the autonumber worked as expected.
-
WSMarkLiquorman
AskWoody LoungerAugust 14, 2001 at 12:38 pm #537294Thanks for the clarification. I also understood there was a problem with duplicate autonumbers being assigned? Perhaps it had to do with assigning an autonumber that then duplicated one of the appended records. But I never could figure out how this could happen if the autonumber was primary key?
-
WScharlotte
AskWoody LoungerAugust 14, 2001 at 1:10 pm #537298 -
WSMarkLiquorman
AskWoody Lounger
-
-
WScharlotte
AskWoody LoungerAugust 14, 2001 at 12:18 am #537225Sorry, but I disagree with your advice on autonumbers. I’ve been using them without problems since Access 1.0. They are *not* suitable if you want an uninterrupted sequence of numbers, but requiring that suggests that the key will have meaning, and that violates the whole idea of the autonumber.
-
-
WSMarkLiquorman
AskWoody LoungerAugust 10, 2001 at 8:21 pm #536977Yes, the append will fail if certain required fields don’t have data in them. So you can either remove the Required flag (as you did), or just make sure you are supplying valid data in your append. As for relationships, I forgot that Access balks at changing to an autonumber unless you delete relationships, even if you are changing from a long interger. Of course, you only need to change the relationships that include this field. It is not really necessary to delete the PK, since the same field will remain the PK; but this trivial.
I was assuming you were not going to renumber the existing records; rather you just wanted to start numbering new records from the number specified in your append query.
-
WSalpi
AskWoody Lounger -
WSMarkLiquorman
AskWoody Lounger
-
-
-
-
Viewing 0 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
WinRE KB5057589 fake out
by
Susan Bradley
1 hour, 6 minutes ago -
The April 2025 Windows RE update might show as unsuccessful in Windows Update
by
Susan Bradley
1 hour, 14 minutes ago -
Firefox 137
by
Charlie
3 hours, 58 minutes ago -
Whisky, a popular Wine frontend for Mac gamers, is no more
by
Alex5723
7 hours, 26 minutes ago -
Windows 11 Insider Preview build 26120.3863 (24H2) released to BETA
by
joep517
7 hours, 38 minutes ago -
Windows 11 Insider Preview build 26200.5551 released to DEV
by
joep517
7 hours, 40 minutes ago -
New Windows 11 PC setup — can I start over in the middle to set up a local id?
by
ctRanger
46 minutes ago -
Windows 11 Insider Preview Build 26100.3902 (24H2) released to Release Preview
by
joep517
11 hours, 12 minutes ago -
Oracle kinda-sorta tells customers it was pwned
by
Nibbled To Death By Ducks
17 hours, 13 minutes ago -
Global data centers (AI) are driving a big increase in electricity demand
by
Kathy Stevens
1 day, 3 hours ago -
Office apps read-only for family members
by
b
1 day, 6 hours ago -
Defunct domain for Microsoft account
by
CWBillow
1 day, 3 hours ago -
24H2??
by
CWBillow
17 hours, 13 minutes ago -
W11 23H2 April Updates threw ‘class not registered’
by
WindowsPersister
11 hours, 27 minutes ago -
Master patch listing for April 8th, 2025
by
Susan Bradley
11 hours, 41 minutes ago -
TotalAV safety warning popup
by
Theodore Nicholson
2 hours, 28 minutes ago -
two pages side by side land scape
by
marc
3 days, 3 hours ago -
Deleting obsolete OneNote notebooks
by
afillat
3 days, 6 hours ago -
Word/Outlook 2024 vs Dragon Professional 16
by
Kathy Stevens
2 days, 8 hours ago -
Security Essentials or Defender?
by
MalcolmP
2 days, 11 hours ago -
April 2025 updates out
by
Susan Bradley
6 hours, 43 minutes ago -
Framework to stop selling some PCs in the US due to new tariffs
by
Alex5723
2 days, 5 hours ago -
WARNING about Nvidia driver version 572.83 and 4000/5000 series cards
by
Bob99
1 day, 19 hours ago -
Creating an Index in Word 365
by
CWBillow
2 days, 21 hours ago -
Coming at Word 365 and Table of Contents
by
CWBillow
1 day, 9 hours ago -
Windows 11 Insider Preview Build 22635.5170 (23H2) released to BETA
by
joep517
4 days, 1 hour ago -
Has the Microsoft Account Sharing Problem Been Fixed?
by
jknauth
4 days, 4 hours ago -
W11 24H2 – Susan Bradley
by
G Pickerell
4 days, 6 hours ago -
7 tips to get the most out of Windows 11
by
Alex5723
4 days, 4 hours ago -
Using Office apps with non-Microsoft cloud services
by
Peter Deegan
6 hours, 6 minutes ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.