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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Row Numbers or Autonumber

Status
Not open for further replies.

PRIreland

Technical User
Apr 24, 2006
16
US
I have a situation where I've got multiples of an item that I need to make unique. I can find them using a find duplicates query. What I want to do is append them to a table that has an autonumber field and then use that number to append to each duplicate to make it unique. For instance, two parts names TRYC would end up becoming TRYC1 and TRYC2.
But, the autonumber field doesn't reset in a table when you just delete the rows. Somehow, the dumb thing remembers what number it has and goes on from so that when I append the next set of duplicates, I get autonumbers of 3 and 3, so on and so forth. I don't want this to happend.
1) Is there a way to make the autonumber reset itself using a query or a macro?
2) Is there a way to make the query show what row number the data is on, if I could do this, then I wouldn't append anything to a separate table, I'd just use the row number from the query as the suffix for my part names.
3) Any other ideas as to how to do this?

As you know, I'm not a V.B. Programmer so I don't mind doing things crudely.

Thanks

Patrick
 
Is there a way to make the autonumber reset itself using a query
ALTER TABLE myTable ALTER COLUMN myID COUNTER(1,1);

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
That work absolutely perfectly.

Thank you!!!

Patrick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top