Unique incremental field

TheEditor

New member
Local time
Today, 10:47
Joined
May 25, 2011
Messages
5
I'm working on an asset tracking db for our use in house. Very simple structure.
tblClientGeneral has a client_id and a client_name. tblAssetTag is linked by client_id 1-M.

I originally was using autonumber random to generate the a unique asset tag but realized quickly that that can give a negative number and also it's not exactly good practice.

Now i'm a little stumped. My primary key is just an id field. So what is the best way to create a field that will generate an auto increment number for my asset tags. They must be unique. I'd like 8 digits with no preceding 0's and all positive.

I've seen a few things but I'm not sure what is the best way to go about this..

Thanks
Bruce
 
I would probably just use a standard autonumber field (Increment instead of Random). You could either let it start from 1 and add 10,000,000 to it for display to the user, or seed it before you start so it runs from the desired number.
 

Users who are viewing this thread

Back
Top Bottom