I want to change the autonumber of the field in table to 1000
and to preserve the old number from 1 to 22.Is there any code in Visual basic to do
that?. This concerns my tables Houses where houseid up to now is 22.I want the next
autonumber to be 1000.
Can somebody help me ?
![]() |
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 |
-
Change autonumber (Access 2000)
Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Change autonumber (Access 2000)
- This topic has 10 replies, 7 voices, and was last updated 19 years, 6 months ago.
AuthorTopicWSsamotek
AskWoody LoungerAugust 3, 2005 at 2:06 pm #422584Viewing 3 reply threadsAuthorReplies-
WSHansV
AskWoody LoungerAugust 3, 2005 at 2:29 pm #964224You can create an append query that adds a record with value 1000 for the AutoNumber field. If you prefer, you can run this in VBA:
Dim strSQL As String
strSQL = “INSERT INTO [NameOfTable] ( [NameOfField] ) VALUES ( 1000 )”
DoCmd.SetWarnings False
DoCmd.RunSQL strSQL
DoCmd.SetWarnings TrueReplace NameOfTable with the name of the table and NameOfField with the name of the field.
-
WSsamotek
AskWoody Lounger
-
WBell
AskWoody_MVPAugust 3, 2005 at 2:29 pm #964223It isn’t that easy to reset the Autonumber next value to a specific number. One technique is to use an append query which specifies a value of 999, then delete that record. Then the next number used will be 1000. Note however that if someone starts entering a record and then cancels, that number is used up, and the next number will be 1001. If you are trying to manipulate autonumbers, you might want to reconsider and use another scheme such as using the max value of existing records, or storing the next number in a table and doing the increment function on your own.
PS – you cannot change the number to be a regular integer, add a record, and then change it back to autonumber – Access won’t let you.
WSMarkLiquorman
AskWoody LoungerAugust 3, 2005 at 2:55 pm #964237I would just like to add 1 little thought to the answers given by Hans and Wendell, as sometimes there is a problem with appending records to a table in which there is an autonumber (and you force the value for this field).
I’d use the append query to set the # of the new record to 998. Then I would open the table in datasheet view and manually start adding a new record (you won’t actually try to save this record, just start data entry and cancel later). As soon as you start any data entry on the new record, Access will assign the autonumber. Make sure it is 999. If it is, everything is OK. If not, navigate to my website (see below) for a tool that will help you correct the autonumber setting.
WSFrancois
AskWoody LoungerAugust 3, 2005 at 5:45 pm #964278-
WSNYIntensity
AskWoody Lounger -
WScavok
AskWoody Lounger -
WSHansV
AskWoody Lounger -
WScavok
AskWoody LoungerDecember 7, 2005 at 4:34 pm #989063Thanks for the welcome. I may have been slightly off the topic – it’s now after 3:30 AM and I should have waited till the morning.
I frequently have to import multiple related tables. In Access 97 I never had a problem but in 2000 the autonumbering gets messed up – the next autonumber ID assigned to a new record has already been used so new records can’t be added until i have reset the autonumber field to a higher number than the biggest already assigned in the imported table.
See also “problem with repeating autonumbers (Access 97)” [Post: 513,879) and Mark Liquorman’s website http://www.Liquorman.net under “Tips and Downloads”. According to Mark: “The problem with AutoNumbers is a known and documented Access 2000 problem.”
I agree that a manually incremented Id would avoid my problem, but there are a lot of tables in a lot of databases that would need to be changed. Anyway, all I was saying is that it is valid and sometimes necessary to want to set the next available autonumber. Autonumbering is a convenience, it would be more convenient if you could easily set the next number occasionally, especially when it is malfunctioning..
-
WSHansV
AskWoody LoungerDecember 7, 2005 at 4:45 pm #989064OK, thanks for the explanation. I agree that the contents of an AutoNumber field matter if there are records in other tables linked to it.
I think Francois’ remark was directed more to people who want to reset an AutoNumber for aesthetic reasons. They have added some records (for example in a test) and deleted them again. They don’t like the resulting gap in the AutoNumber sequence. If prevention of such gaps is really important, it’s better not to use an AutoNumber field.
-
-
-
Viewing 3 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
-
Need help with graphics… (Awaiting moderation)
by
WSBatBytes
36 minutes ago -
AMD : Out of Bounds (OOB) read vulnerability in TPM 2.0 CVE-2025-2884
by
Alex5723
11 hours, 32 minutes ago -
Totally remove or disable BitLocker
by
CWBillow
10 hours, 26 minutes ago -
Windows 10 gets 6 years of ESU?
by
n0ads
7 hours, 15 minutes ago -
Apple, Google stores still offer China-based VPNs, report says
by
Nibbled To Death By Ducks
22 hours, 19 minutes ago -
Search Forums only bring up my posts?
by
Deo
22 hours, 32 minutes ago -
Windows Spotlight broken on Enterprise and Pro for Workstations?
by
steeviebops
1 day, 10 hours ago -
Denmark wants to dump Microsoft for Linux + LibreOffice
by
Alex5723
1 day, 2 hours ago -
How to get Microsoft Defender to honor Group Policy Setting
by
Ralph
1 day, 10 hours ago -
Apple : Paragon’s iOS Mercenary Spyware Finds Journalists Target
by
Alex5723
1 day, 20 hours ago -
Music : The Rose Room – It’s Been A Long, Long Time album
by
Alex5723
1 day, 21 hours ago -
Disengage Bitlocker
by
CWBillow
1 day, 11 hours ago -
Mac Mini M2 Service Program for No Power Issue
by
Alex5723
1 day, 23 hours ago -
New Win 11 Pro Geekom Setup questions
by
Deo
22 hours, 28 minutes ago -
Windows 11 Insider Preview build 26200.5651 released to DEV
by
joep517
2 days, 7 hours ago -
Windows 11 Insider Preview build 26120.4441 (24H2) released to BETA
by
joep517
2 days, 7 hours ago -
iOS 26,, MacOS 26 : Create your own AI chatbot
by
Alex5723
2 days, 11 hours ago -
New PC transfer program recommendations?
by
DaveBoston
15 hours, 58 minutes ago -
Windows 11 Insider Preview Build 22631.5545 (23H2) released to Release Preview
by
joep517
2 days, 15 hours ago -
Windows 10 Build 19045.6029 (22H2) to Release Preview Channel
by
joep517
2 days, 15 hours ago -
Best tools for upgrading a Windows 10 to an 11
by
Susan Bradley
2 days, 3 hours ago -
The end of Windows 10 is approaching, consider Linux and LibreOffice
by
Alex5723
1 day, 7 hours ago -
Extended Windows Built-in Disk Cleanup Utility
by
bbearren
1 day, 16 hours ago -
Win 11 24H2 June 2025 Update breaks WIFI
by
dportenlanger
3 days, 10 hours ago -
Update from WinPro 10 v. 1511 on T460p?
by
CatoRenasci
2 days, 8 hours ago -
System Restore and Updates Paused
by
veteran
3 days, 12 hours ago -
Windows 10/11 clock app
by
Kathy Stevens
2 days, 23 hours ago -
Turn off right-click draw
by
Charles Billow
3 days, 15 hours ago -
Introducing ChromeOS M137 to The Stable Channel
by
Alex5723
3 days, 19 hours ago -
Brian Wilson (The Beach Boys) R.I.P
by
Alex5723
7 hours, 49 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.