Autonumber

  • Thread starter Thread starter Nick
  • Start date Start date
N

Nick

Hi

A quick one I think !! Can you set the autonumber to start
at anything ?? I would like my autonumber to start at
1..... but I would also like it to have 4 digits...for
example the first record will look like

1001
1002
1003

etc...just an after thought what would happen (if!!) I was
to get to 1999- would it go to 2000 or would it crash !!!

Thanks
 
You can make the autonumber start with anything you want provided your
table contains no records yet.
This is a wrong way to use autonumber, though. AN is not guaranteed to
abide to any typical rules you would expect, and if you do use it for
sequential numbering, we will be seeing your questions here later - Why
do I have gaps? How do I reset AN? How come I have AN like 1, 2, 3, and
then immediately 45009, 556021?.
AN should not be used for anything other than a unique ID for records.
If you are looking for a meaningful numbering, create a Number field and
fill it in yourself.

Pavel
 
YEst you can, in an Empty table, set the starting value but
You really shouldn't use Autonumber for anything meaningful
Worst case, if you go to Replication, all the numbers get randomised.

If you are trying to display someting like an invoice, but don't want
the customers to know you've jst started up,
Use a calculated field on your Report
= InvoiceID + 1000
Where InvoiceID is your Autonumber
Or you can roll your own incrementing field. Then you can make it do
anything you want.
 
How do you set the starting number?


Greg Kraushaar said:
YEst you can, in an Empty table, set the starting value but
You really shouldn't use Autonumber for anything meaningful
Worst case, if you go to Replication, all the numbers get randomised.

If you are trying to display someting like an invoice, but don't want
the customers to know you've jst started up,
Use a calculated field on your Report
= InvoiceID + 1000
Where InvoiceID is your Autonumber
Or you can roll your own incrementing field. Then you can make it do
anything you want.
 
Apparently, you've missed the point that you should NOT want to set it
to anything other than it is going to be automatically.
Anyway, to set it, create a table with AN field and execute:

INSERT INTO MyTable MyANfield VALUES( 99 )
DELETE * FROM MyTable

to start AN at 100.

Pavel
 
Back
Top