How can I change a number field to autonumber? I want the new autonumber field to keep the same number as the current number field.
Thank you in advance.
![]() |
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 field to autonumber (2002)
Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Change field to autonumber (2002)
- This topic has 3 replies, 2 voices, and was last updated 16 years, 9 months ago.
AuthorTopicViewing 0 reply threadsAuthorReplies-
WSHansV
AskWoody LoungerAugust 12, 2008 at 6:43 am #1120826You can’t change an existing field to an AutoNumber field. You could do the following; this will only be easy if the table isn’t involved in relationships with other tables.
– Select the table in the database window.
– Copy it (Ctrl+C).
– Paste it (Ctrl+V), specify a name and select the option to paste the structure only.– Open the new table in design view.
– If there are indexes involving the number field, delete them.
– Delete the number field.
– Create a new field of type AutoNumber, and give it the same name as the field that you removed.
– Close and save the new table.– Create a query in design view based on the old table.
– Select Query | Append Query and specify the new table as target.
– Drag all fields or * to the query grid. Access should automatically assign the target fields.
– Select Query | Run or click the Run button on the toolbar.
– You can discard the query or save it.– Delete the old table.
– Rename the new table to the name of the old one. -
WSrobinr
AskWoody LoungerAugust 13, 2008 at 2:13 am #1121139I don’t think that would work. I have another idea but don’t know how to do it. The field I want to increment the number in is in a subform. Instead of have an autonumber can I have it take the last number – in the table and add 1 to it?
Thanks Hans for always responding and being such a big help. -
WSHansV
AskWoody LoungerAugust 13, 2008 at 2:25 am #1121140You could use the Before Update event of the subform for this:
Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim lngID As Long
If Me.NewRecord Then
lngID = Nz(DMax(“ID”, “tblSomething”), 0) + 1
Me.ID = lngID
End If
End SubHere, tblSomething is the name of the table on which the subform is based, and ID is the name of the field that you want to increment.
The disadvantage is that the number will only be assigned when the new record is saved. You could use the Before Insert event instead, but that would be risky in a multi-user environment – two users could easily assign the same number to different records.
-
-
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
-
89 million Steam account details just got leaked,
by
Alex5723
7 hours, 23 minutes ago -
KB5058405: Linux – Windows dual boot SBAT bug, resolved with May 2025 update
by
Alex5723
7 hours, 31 minutes ago -
A Validation (were one needed) of Prudent Patching
by
Nibbled To Death By Ducks
1 hour, 58 minutes ago -
Master Patch Listing for May 13, 2025
by
Susan Bradley
53 minutes ago -
Installer program can’t read my registry
by
Peobody
29 minutes ago -
How to keep Outlook (new) in off position for Windows 11
by
EspressoWillie
21 hours, 1 minute ago -
Intel : CVE-2024-45332, CVE-2024-43420, CVE-2025-20623
by
Alex5723
3 hours, 38 minutes ago -
False error message from eMClient
by
WSSebastian42
18 hours, 39 minutes ago -
Awoke to a rebooted Mac (crashed?)
by
rebop2020
1 day, 3 hours ago -
Office 2021 Perpetual for Mac
by
rebop2020
1 day, 4 hours ago -
AutoSave is for Microsoft, not for you
by
Will Fastie
1 hour, 32 minutes ago -
Difface : Reconstruction of 3D Human Facial Images from DNA Sequence
by
Alex5723
1 day, 8 hours ago -
Seven things we learned from WhatsApp vs. NSO Group spyware lawsuit
by
Alex5723
9 hours, 30 minutes ago -
Outdated Laptop
by
jdamkeene
1 day, 13 hours ago -
Updating Keepass2Android
by
CBFPD-Chief115
1 day, 19 hours ago -
Another big Microsoft layoff
by
Charlie
1 day, 18 hours ago -
PowerShell to detect NPU – Testers Needed
by
RetiredGeek
22 hours, 24 minutes ago -
May 2025 updates are out
by
Susan Bradley
12 hours, 2 minutes ago -
Windows 11 Insider Preview build 26200.5600 released to DEV
by
joep517
2 days, 1 hour ago -
Windows 11 Insider Preview build 26120.3964 (24H2) released to BETA
by
joep517
2 days, 1 hour ago -
Drivers suggested via Windows Update
by
Tex265
2 days ago -
Thunderbird release notes for 128 esr have disappeared
by
EricB
1 day, 22 hours ago -
CISA mutes own website, shifts routine cyber alerts to X, RSS, email
by
Nibbled To Death By Ducks
2 days, 7 hours ago -
Apple releases 18.5
by
Susan Bradley
2 days, 2 hours ago -
Fedora Linux 40 will go end of life for updates and support on 2025-05-13.
by
Alex5723
2 days, 9 hours ago -
How a new type of AI is helping police skirt facial recognition bans
by
Alex5723
2 days, 9 hours ago -
Windows 7 ISO /Windows 10 ISO
by
ECWS
18 hours, 22 minutes ago -
No HP software folders
by
fpefpe
2 days, 17 hours ago -
Which antivirus apps and VPNs are the most secure in 2025?
by
B. Livingston
1 day, 14 hours ago -
Stay connected anywhere
by
Peter Deegan
2 days, 23 hours 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.