Microsoft Access Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft Access Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old January 20th, 2005, 10:55 PM
ranbir singh ranbir singh is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 24 ranbir singh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 20 m 18 sec
Reputation Power: 0
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

Reply With Quote
  #2  
Old January 21st, 2005, 12:20 AM
lwells lwells is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Sep 2004
Posts: 632 lwells User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 h 59 m 38 sec
Reputation Power: 5
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.

Reply With Quote
  #3  
Old January 21st, 2005, 01:36 AM
ranbir singh ranbir singh is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 24 ranbir singh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 20 m 18 sec
Reputation Power: 0
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

Reply With Quote
  #4  
Old January 21st, 2005, 08:54 AM
lwells lwells is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Sep 2004
Posts: 632 lwells User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 h 59 m 38 sec
Reputation Power: 5
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

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft Access Development > how to make autonumber to start with value


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT