Wednesday, December 30, 2009

Problem with Automatic Numbering in Access?

My database (in Access) uses an Auto No field. I have accidentally deleted some records. I do not want to get them back but I want to use their numbers. How can I do this?Problem with Automatic Numbering in Access?
switch the table into design mode, add a new numeric field of data type auto number, set indexed to yes (no duplicates)





right click the new field row in the top section of the design window and select primary key.





delete your old primary key field





rename your new field the same as the field you just deleted (ID by default)Problem with Automatic Numbering in Access?
Access does not reuse the numbers, if your doing incremental and want to start over you can import them into a new table with autonumber / incremental on
You鈥檒l have to change the data type from AutoNumber to text, then add the rows and data you want in that position. Hint: use the text (numbers) to confirm you have it in the right order, then Add a new field to the table, and define its data type AutoNumber. Access then enters data in the AutoNumber field automatically, numbering the records consecutively starting with 1. Delete the old field you changed from AutoNumber to text.





I just tried this on a table and it worked for me. Try it on a mock table first to be sure you understand what you're doing. You can insert rows but if you have AutoNumber on it puts in on the bottom; therefore, you have to change it before you insert the row. Sorry I wasn't clear before.
You can't, that is without doubt a very good feature because you can't possibly give, say, a customer whether ex or current the same number. If you need to use numbers again, then I suggest you don't use autonumber but number them manually.
You can't...that's why it is called auto number, and not manual number.

No comments:

Post a Comment