-
1
- #1
MChancellor
Technical User
I didn't realize this, but sometimes when you have tested a table that has an autonumber with sample data, to reset the autonumber you have to copy and paste the structure of the table into a new table.<br>
<br>
I had tried the method of using an append query to reset the autonumber to 1 after having used test data in the forms based on these tables, and it did not reset the number. A co-worker gave me the information on needing to copy and paste the table instead. The steps for doing so are as follows:<br>
<br>
Highlight the name of the table that you want to copy.<br>
<br>
Click on the copy icon on the toolbar (or do Edit->Copy, or Ctrl-C)<br>
<br>
Click in the "Tables" tab - so that none of the table names are highlighted.<br>
<br>
Click on the paste icon on the toolbar (or do Edit->Paste, or Ctrl-V)<br>
<br>
It will then pop up a dialog box with 3 paste options: Structure Only, Structure and Data, or Append Data to Existing Table.<br>
<br>
To reset the autonumber you want to choose "Structure Only" and type "Temp" for the table name. This will paste a table with identical structure to the one that you want to reset the autonumber of. <br>
<br>
At this point just rename the "Temp" table to the name of the table whose autonumber you want to reset to 1. It will ask you if you want to delete the original table of that name, and delete the contents from the clipboard. Answer yes to this. Something else it might prompt you about is if you had relationships defined already on the first table. You will want MS Access to go ahead and delete these relationships.<br>
<br>
Then, the table is ready to go with the autonumber reset.<br>
<br>
**NOTE: This should only be done on tables that have SAMPLE data in them. Doing this to a table with actual data will have disastrous results, as you can well imagine. <br>
<br>
Just thought I'd share.. hope it helps someone.
<br>
I had tried the method of using an append query to reset the autonumber to 1 after having used test data in the forms based on these tables, and it did not reset the number. A co-worker gave me the information on needing to copy and paste the table instead. The steps for doing so are as follows:<br>
<br>
Highlight the name of the table that you want to copy.<br>
<br>
Click on the copy icon on the toolbar (or do Edit->Copy, or Ctrl-C)<br>
<br>
Click in the "Tables" tab - so that none of the table names are highlighted.<br>
<br>
Click on the paste icon on the toolbar (or do Edit->Paste, or Ctrl-V)<br>
<br>
It will then pop up a dialog box with 3 paste options: Structure Only, Structure and Data, or Append Data to Existing Table.<br>
<br>
To reset the autonumber you want to choose "Structure Only" and type "Temp" for the table name. This will paste a table with identical structure to the one that you want to reset the autonumber of. <br>
<br>
At this point just rename the "Temp" table to the name of the table whose autonumber you want to reset to 1. It will ask you if you want to delete the original table of that name, and delete the contents from the clipboard. Answer yes to this. Something else it might prompt you about is if you had relationships defined already on the first table. You will want MS Access to go ahead and delete these relationships.<br>
<br>
Then, the table is ready to go with the autonumber reset.<br>
<br>
**NOTE: This should only be done on tables that have SAMPLE data in them. Doing this to a table with actual data will have disastrous results, as you can well imagine. <br>
<br>
Just thought I'd share.. hope it helps someone.