A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

how do I add an auto-number field to an existing database?



 
 
Thread Tools Display Modes
  #1  
Old February 28th, 2005, 07:21 PM
Kornfused
external usenet poster
 
Posts: n/a
Default how do I add an auto-number field to an existing database?

After I'd already started entering info into a new database, I decided that I
did want autonumbering after all. When I tried to add an autonumber field,
it tells me that autonumbering can't be applied to databases that already
have data entered. What gives? Isnt' there a way around this?
  #2  
Old February 28th, 2005, 08:09 PM
Ken Snell [MVP]
external usenet poster
 
Posts: n/a
Default

You can add a new field to the table, and make the new field an autonumber
type (so long as you don't already have an autonumber field in that table).
You can't change an existing field to an autonumber type after you've added
data to the table.

--

Ken Snell
MS ACCESS MVP

"Kornfused" wrote in message
...
After I'd already started entering info into a new database, I decided
that I
did want autonumbering after all. When I tried to add an autonumber
field,
it tells me that autonumbering can't be applied to databases that already
have data entered. What gives? Isnt' there a way around this?



  #3  
Old March 2nd, 2005, 03:43 AM
external usenet poster
 
Posts: n/a
Default

NOT AT THIS TIME
-----Original Message-----
After I'd already started entering info into a new

database, I decided that I
did want autonumbering after all. When I tried to add an

autonumber field,
it tells me that autonumbering can't be applied to

databases that already
have data entered. What gives? Isnt' there a way around

this?
.

  #4  
Old March 2nd, 2005, 04:07 PM
Tim Ferguson
external usenet poster
 
Posts: n/a
Default

=?Utf-8?B?S29ybmZ1c2Vk?= wrote in
:

After I'd already started entering info into a new database, I decided
that I did want autonumbering after all. When I tried to add an
autonumber field, it tells me that autonumbering can't be applied to
databases that already have data entered. What gives? Isnt' there a
way around this?


If you already have numbers that you want to retain as identifiers, then
you can keep them and add autonumbering on top. Make a couple of backups
first though!!

In the database window, copy the table and then paste it back as
Structure Only. Delete the old number field and replace it with an
Autonumber field with the same name.

Now in the Query Designer, make an append query that copies all the
records from the old table into the new one: including the old number
field into the new number field.

Once you are happy that all the records look okay, you can delete the old
table, removing any relationships first, though. Rename the new one to
the old name. Check all the indexes and re-establish the relationships.

The new table will start its autonumbering at one more than the highest
number that you imported. Easy!

Hope that helps


Tim F

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
how do you create an auto number field in Access using DDL? KhalilS Database Design 2 February 28th, 2005 11:40 AM
Auto Number Field Change pcteacher General Discussion 4 October 20th, 2004 02:10 AM
query a number stored as text Lee Running & Setting Up Queries 19 October 13th, 2004 04:10 AM
How do I create a calculated field which displays a auto number ? Adrian General Discussion 2 August 10th, 2004 01:45 PM
NUMBERING the pages Bob New Users 7 June 14th, 2004 12:20 AM


All times are GMT +1. The time now is 11:47 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.