Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

access+training - primary key high start

Forum home » Delegate support and help forum » Microsoft Access Training and help » access+training - Primary key with high start number

access+training - Primary key with high start number

ResolvedVersion Standard

Mark has attended:
Access Intermediate course
Access Advanced course
Access VBA course

Primary key with high start number

In a new database can I start a primary key autonumber on a number other than 1, I want to start it at 3000. If so how?

RE: Primary key with high start number

Hi Mark

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

RE: Primary key with high start number

Yes it worked, thank you.

Access tip:

Dsum

You can create percentage values based on individual products / items by using a Dsum function (used with a grouped query)

[Each value column] / Dsum[field:total for the column needed to be calculated],[tablename]

View all Access hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.12 secs.