locked
Need to change in auto nuber field RRS feed

  • Question

  • I am doing a project in MS Access

    where I need to change in auto number of a table

    table starts from 1 to onwards

    and I want to start from some other digit as 1000

    Wednesday, April 29, 2020 6:44 AM

All replies

  • where I need to change in auto number of a table

    Hi shahid,

    Autonumbers should ONLY be used to uniquely identify a record. No other meaning for the user should be added.

    You can make an additional field in the table for the number(s) you want to use.

    Imb.

    Wednesday, April 29, 2020 7:06 AM
  • Check if this works

    ALTER TABLE [YOURTABLE] ALTER
     COLUMN [YOUR_AUTONUMBER_FIELD] COUNTER (100,1).
    Check this for many solutions : https://superuser.com/questions/288087/how-do-i-set-the-first-value-of-autonumber-in-access/288094


    Wednesday, April 29, 2020 9:59 AM
  • You might like to take a look at CustomNumber.zip in my public databases folder at:

    https://onedrive.live.com/?cid=44CC60D7FEA42912&id=44CC60D7FEA42912!169

    This little demo file illustrates a number of ways to compute sequential numbers when rows are inserted into a table via a form, or a set of rows is inserted by executing an SQL statement in code.  Provision is also made for 'seeding' the value at which the next row to be inserted will start.

    Ken Sheridan, Stafford, England

    Wednesday, April 29, 2020 10:56 AM
  • Autonumbers should hold no meaning to you, as a developer, or to your users.  They are meant to simply be a unique identifier for each record and nothing more.  They don't even have to be numeric.

    So when you do need to have a field whose value have meaning and you want to be able to control it, then you need to create your own field to hold such data.  Then you can do as you please.  So simply create a new, numeric, field in your table.

    I'm sure Ken's example illustrates exactly this.


    Daniel Pineault, 2010-2019 Microsoft MVP
    Professional Support: http://www.cardaconsultants.com
    MS Access Tips and Code Samples: http://www.devhut.net

    Wednesday, April 29, 2020 3:59 PM