Define Autonumber Position

  • Thread starter Thread starter kingofthedamned
  • Start date Start date
K

kingofthedamned

Guest
HELP!!!!someone please

this probibly is one of those duh! (smack head on desk) questions but does anyone know how to make an auto number start from eg. 16524512 rather than 1? (in access xp)
 
I am sure there is a more sophisticated way but I would add a field to a query as:

NewNumber:[AutoNumber]+16524511

and then use NewNumber as my ID field

Mike
 
Why would you want to use an autonumber for this purpose. If you are trying to create a specific sequence then create your number manually. If you think the autonumber will generate a sequence you are bound to see anomalies due to cancelled records, deleted records, etc.
 
If for some reason you really do want autonumber to start at x then you could do something like

for x=currentautonumber to autonumberwanted
create record
delete record
next

that 'orrible hack would do what you want.
 
other ways to do it

is it possible to change the autonumber starting number in design view of a table?
 
no, an autonumber is pretty much gaurnteed to be unique (that is its main job in life), if you could alter it...well...its uniqueness would be questioned.

If I have a problem where the program/user wants an id thats unique but in some funny format then I tend to have two ID fields. The autonumber is used internally (in where clauses etc) and is the primary key. The other id is generated based on the autonumber, and formatted however needed...it is not used in any keys and is only displayed.

I don't know if this is correct from a database design point of view but it satisfies RL.
 
cable said:
If I have a problem where the program/user wants an id thats unique but in some funny format then I tend to have two ID fields. The autonumber is used internally (in where clauses etc) and is the primary key. The other id is generated based on the autonumber, and formatted however needed...it is not used in any keys and is only displayed.

That's the way I work with my databases.
 

Users who are viewing this thread

Back
Top Bottom