Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

auto number an existing table

Status
Not open for further replies.

Shusha

IS-IT--Management
Jun 27, 2001
50
CA
Hi there,

I have read all the stuff on autonumber but cant understand where i am going wrong..

. this is my problem.. i have a table already created with 1000 over records by the user.. the data is coming in from another system where random numbers are generated. i wld like to have a sequential number starting at 10,000 with all of these records.. i tried to create a temp table and append it to another table ( also empty) , and i did get a autokey that started at 10,000 but i cld not attach my old file to it..
Help!!!!!!!!!!!!!!!

usha
 
You are doing nothing wrong. An autonumber is intended for primary keys, that should have no meaning in the data sense.
If you want to count things, a query with a count function is probably what you want.

Best regards
 
Hi, thks for ur reply.. I understand the fact that it is purely used for primary key. that is all i wish to use it for. But i already have masterkeys which i wish to get rid off and give them an autokey that starts at 10000.

i work with 4 regions data and i can use only masterkeys between 10,000 and 20,000 for a particualr region. this region is the one with scattered maskeys. I figure once i change these mastkeys to start at 10,000 i can sfaely add the remaining 300 odd records and hope the client population does not go ver 10,000 records.. even if i did i wld be gone before that ( i mean i wld have found other thigns to do than worry about their masternos (;-)

So my question is how do i make a file with the existing field names, add a masterkey that starts at 10000 and then safely transfer all records to that file.. thks
usha

 
Nope. I don't think you understand fully. DO NOT rely on autonumbers if the number has any meaning. Here it clearly has meaning. You could add another field that records which region it comes from, and then it wouldn't matter what number was in there. Or you could use a scheme to roll your own unique ID (there's great code in the Access Developer's Handbook). But do not use an autonumber field to help you distinguish between regions.

Jeremy ==
Jeremy Wallace
AlphaBet City Dataworks
Affordable Development, Professionally Done

Please post in the appropriate forum with a descriptive subject; code and SQL, if referenced; and expected results. See thread181-473997 for more pointers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top