|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
how to make autonumber to start with value
i have created a forms for candidate profiles
i want my autonumber to start from 1000 instead of 1, 2 or 3 |
|
#2
|
|||
|
|||
|
Create a new query (don't base it on any table or query) and switch to SQL view and paste the following code into the SQL window:
PARAMETERS [Number] Long; INSERT INTO NameOfTable (NameOfAutoIDField) SELECT [Number] AS Expr1; Type the exact name of the table that you want to change the autonumber where I have NameOfTable. Type the exact name of the field that is your autonumber field where I have typed NameOfAutoIDField. Press the Red Exclaimation icon on the tool bar to run the query. A parameter form will open that says number. Type one number less than you want to start at. For example if you want the number to start at 1000, then type in 999. Then the next new record will now be at 1000. Just for curiosity, why do you want the number to start at 1000? The Primary Key is just that... a Primary Key to keep the record unique from any other record, which makes the number sequence unimportant. The autonumber sequence makes keeping the records unique very simple. If you are going to use this for any other purpose, then you will be making a very big mistake. lwells Last edited by lwells : January 21st, 2005 at 12:31 AM. |
|
#3
|
|||
|
|||
|
the purpose of having number to start from 1000 is that
we want our company database of employees to starts from SAG1000 wherein SAG is scientific Animation Graphics. a sort of Candidate ID which would help us to keep track of in record. in future if we want to search for Candidate ID SAG1025... simply put it into Canidate ID text field and rest of the data related to the concerned employee would show up in respective form will it be the right way or not ???? let me know can you chat with me in msn id singh_ranb@hotmail.com i need more help too |
|
#4
|
|||
|
|||
|
Hi ranbir,
Actually, I don't recommend using the autonumber for this purpose. It would be better to set up a different field for this. The primary reason, is that if the record was deleted for any reason or became corrupt...even if restored...will then get a new autonumber. It would be better to set up an ID for the candidate that is not part of your Primary Key. lwells |
![]() |
| Viewing: Dev Articles Community Forums > Databases > Microsoft Access Development > how to make autonumber to start with value |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|