Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Database Design / December 2003

Tip: Looking for answers? Try searching our database.

Maintaining Autonumber Values

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
dbarnas - 31 Dec 2003 16:42 GMT
Hi,

I have imported a table into a new mdb and I wish to change the ID field
(Primary Key) to an autonumber field but I am not able to.

I created a new field and set it as an autonumber field but it did not
sequence my records with the same numbers as the ID field.

I would like to create an autonumber field with the same sequence of numbers
as the imported tables ID field had because a number of other tables use
this primary key as a foreign key and so I need to maintain the
relationship.

Any suggestions on how to accomplish this?

Thanks.

Dave
John Vinson - 31 Dec 2003 18:22 GMT
>Hi,
>
[quoted text clipped - 10 lines]
>
>Any suggestions on how to accomplish this?

You can do so by creating a new, empty table with an Autonumber field;
run an Append query from the imported table into this new table,
appending the ID to the Autonumber field. The existing data will be
copied into the autonumber field (this is in fact the only way to set
an Autonumber to a chosen value rather than autoincrementing it).

                 John W. Vinson[MVP]    
   Come for live chats every Tuesday and Thursday
http://go.compuserve.com/msdevapps?loc=us&access=public
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.