Autonumber in specified format

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm creating a table with the help of a make-table query.One of the fields in
the table REP_ID needs to have a start value of 1000 and should be
incremented automatically by 1 for every next record.
I tried changing the type to AutoNumber but thst does not work.
I've also tried creating an Update query to change the field contents but
does not seem to work.
Any ideas?

Thanks.
DD.
 
Create a function and use this code to
explicitly set the value of the counter.

Here is an example of how I used it...

Dim db As DAO.Database
Dim strReset As String

Set db = CurrentDb

strReset = "ALTER TABLE tblVendor ALTER COLUMN VendorIDPK COUNTER (200, 1)
;"
db.Execute strReset, dbFailOnError

You'll want to replace the table and column names with your own and change
the 200 to the counter value that you need.

Cheers,
Eric
 
Back
Top