Friday, 27 May 2011

reset autonumber

Method 1
You can reset an AutoNumber field value so it corresponds with one of the fields in the table. To do this in Microsoft Office Access 2003 and in earlier versions, follow these steps:
  1. Delete the AutoNumber field from the main table.

    Make note of the AutoNumber field name.
  2. Click Queries on the left pane. Double-click Create query in Design view on right pane.
  3. In the Show Table dialog box, select the main table. Click Add and then click Close.
  4. Double-click the required fields in the table view of the main table to select the fields.
  5. Select the required Sort order.
  6. On the Query menu, click Make-Table Query. Type the new table name in the Table Name text box and then click OK.
  7. On the Query menu, click Run.
  8. A dialog box appears with the text that follows: You are about to append # row(s) into a new table. Click Yes to insert the rows.
  9. On the File menu, click Close. Click No to close the Make-Table Query window.
  10. Click Tables on the left pane. Right-click the new table and then click Design View.
  11. In the Design view for the table, add an AutoNumber field with the same field name that you deleted in step 1. Add this AutoNumber field to the new table and then save the table.
  12. Close the Design view window.
  13. Rename the main table name. Rename the new table name to the main table name.

No comments:

Post a Comment