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 ?
![]() |
There are isolated problems with current patches, but they are well-known and documented on this site. |
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
-
Rufus is available from the MSFT Store
by
PL1
1 hour, 50 minutes ago -
Microsoft : Ending USB-C® Port Confusion
by
Alex5723
4 hours ago -
KB5061768 update for Intel vPro processor
by
drmark
13 minutes ago -
Outlook 365 classic has exhausted all shared resources
by
drmark
2 hours, 11 minutes ago -
My Simple Word 2010 Macro Is Not Working
by
mbennett555
19 hours, 11 minutes ago -
Office gets current release
by
Susan Bradley
2 hours, 22 minutes ago -
FBI: Still Using One of These Old Routers? It’s Vulnerable to Hackers
by
Alex5723
1 day, 16 hours ago -
Windows AI Local Only no NPU required!
by
RetiredGeek
1 day ago -
Stop the OneDrive defaults
by
CWBillow
1 day, 17 hours ago -
Windows 11 Insider Preview build 27868 released to Canary
by
joep517
2 days, 3 hours ago -
X Suspends Encrypted DMs
by
Alex5723
2 days, 5 hours ago -
WSJ : My Robot and Me AI generated movie
by
Alex5723
2 days, 5 hours ago -
Botnet hacks 9,000+ ASUS routers to add persistent SSH backdoor
by
Alex5723
2 days, 6 hours ago -
OpenAI model sabotages shutdown code
by
Cybertooth
2 days, 6 hours ago -
Backup and access old e-mails after company e-mail address is terminated
by
M W Leijendekker
1 day, 19 hours ago -
Enabling Secureboot
by
ITguy
2 days, 2 hours ago -
Windows hosting exposes additional bugs
by
Susan Bradley
2 days, 14 hours ago -
No more rounded corners??
by
CWBillow
2 days, 10 hours ago -
Android 15 and IPV6
by
Win7and10
2 days ago -
KB5058405 might fail to install with recovery error 0xc0000098 in ACPI.sys
by
Susan Bradley
3 days, 3 hours ago -
T-Mobile’s T-Life App has a “Screen Recording Tool” Turned on
by
Alex5723
3 days, 5 hours ago -
Windows 11 Insider Preview Build 26100.4202 (24H2) released to Release Preview
by
joep517
3 days ago -
Windows Update orchestration platform to update all software
by
Alex5723
3 days, 13 hours ago -
May preview updates
by
Susan Bradley
3 days ago -
Microsoft releases KB5061977 Windows 11 24H2, Server 2025 emergency out of band
by
Alex5723
2 days, 16 hours ago -
Just got this pop-up page while browsing
by
Alex5723
3 days, 5 hours ago -
KB5058379 / KB 5061768 Failures
by
crown
3 days, 2 hours ago -
Windows 10 23H2 Good to Update to ?
by
jkitc
2 days, 4 hours ago -
At last – installation of 24H2
by
Botswana12
4 days, 4 hours ago -
MS-DEFCON 4: As good as it gets
by
Susan Bradley
2 hours, 38 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.