Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sequencial numbers starting with....

Status
Not open for further replies.

cheyenne2002

Instructor
Jul 26, 2005
229
US
How can I have my auto numbered primary key start with the number 10000?

Sam
 
Hi
Lots of posts on this. Here is one:
Autonumber from set point
thread700-1087986
 
Create your table with an AutoNumber type field, but don't enter any records. Then create another table with only a single Long Integer Number type field. This field must have same name as the AutoNumber field in the first table. Enter one record in the second table - make the value in the long int field for this record be 9999.

Now create an append query to append the record in the second table to the first table and run the query. You can now delete the second table and begin entering your data into the first table.
 
is there some reason the auto number PK needs to be a specific number? You haven't assigned any meaning to this number (like an invoice number or PO number), right?


Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual

Essential reading for anyone working with databases: The Fundamentals of Relational Database Design
 
My boss just wants the numbers to start at 10,000.

That is why I was asking. I just want to designate the first number.
Sam
 
Ok, just wondering...does your boss expect them to be sequential? Because eventually there will be missing numbers; for example, if someone starts to create a new record and then discards it there will be a gap; you could end up with a sequence like: 10012,10014,10018
 
Okay I further clarification from the boss on the reason for the set numbers.

He is going to duplicate this database, one for business uses and one for personal.

He wants the business properties to start with number 1000001 and the personal numbers to start with 2000001, even though they will be in different databases.....

go figure?

I'm still confused as to the best way to accomplish this. I think appending is the easiest.


Sam
 
I think this is a very bad idea re LesPaul. It implies that your boss thinks that at some stage s/he may join the tables in some way using the autonumber. However, if you really have to do it, PHVs post in the tread I posted should suit. [neutral]
 
The property number is in a relationship. PHV's post says it will only work if it is not in a relationship.

I do not think that the boss will ever combine these databases, in fact, I will tell him he CAN'T.



Sam
 
Remou,

Just another thought, is there another way to get the numbers to sequentially increase with each new record without using the AutoNumber format?

Or.......is there a way to have a field show the previous number used. This way the boss just needs to look at the previous number and increase it by one and type in the new number. That is what he is doing manually now in Excel, but sometimes he forgets the old number and has to go searching for it, hence my suggestion of the autonumber.

Sam
 
Here is a nice unique number:
Why AutoNumber shouldn't be used in MultiUser databases (And How to ge the Unique Number)
faq700-184

If the database is quite simple, with one user at a time, you can use DMax to get the highest number.

 


"My boss...."

does not understand relations database concepts.

Consequently, he/she is making requests/demands that he/she ought not be making.

Mr Boss, tell me WHAT external results you want (user requirements) -- not HOW to do it (technical requirements)!

Skip,

[glasses] [red]Sign above the facsimile apparatus at the music publisher:[/red]
If it ain't baroque...
Don't FAX it![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top