access vba courses - autonumber

TrustPilot

starstarstarstarstar Excellent

  • Home
  • Courses
  • Promotions
  • Schedule
  • Formats
  • Our Clients

Forum home » Delegate support and help forum » Microsoft Access Training and help » access vba courses - AutoNumber

access vba courses - AutoNumber

resolvedResolved · Low Priority · Version Standard

Mike has attended:
Access Advanced course
Access VBA course

AutoNumber

Is it possible to reset an AutoNumber?

RE: AutoNumber

Hi Mike

I am not totally sure what you mean by this, but I have taken my best guess. If this is not what you meant, please re-post with more detail.

Yes this is possible, if you follow the steps outlined below you will be able to do it.

1)Make sure that there is no primary key field set in your database table.
2)Create a new temporary table, within this table create a field with the SAME name as the id field in the original table. In this field enter a number 1 less than you require for your auto number start i.e. 2999.
3)Create a Query in design view and add both the tables.
4)Right mouse click in the grey area where the two tables are shown within the query window. From the menu select Query Type and then Append Query.
5)Within the window that appears, select the original table (the table that you want the auto number to start at 3000) from the drop down list and click OK.
6)Select the one single field that you created in the new table so that it is added to the query. To do this, double click the field.
7)Run the query
8)Open up the original table and when you create a new row, you should see that it starts the numbering from 3000.
9)Set this field as the primary key
10)Delete the temporary table that you created.

Hope this helps

David


 

Access tip:

Zoom feature for queries

If youare working on on query design and creating a calculated field, it can be hard to view the whole statement. You can hold the shift key down and press F2, to show the zoomed up version of the query field

View all Access hints and tips


Server loaded in 0.05 secs.