Is there a way to limit the random ID number for the primary key to a three digit number? I have it set to random and the numbers I get are 10 digits long.I am using Access 2010.
Last edited by Juli; 08-30-2011 at 09:05 PM. Reason: update to version
How are you creating the random number now?
Is your code running too slowly?
Does your workbook or database have a bunch of duplicate pieces of data?
Have a look at this article to learn the best ways to set up your projects.
It will save both time and effort in the long run!
Dave
Dave,
I entered the data type as auto number which only gives two choices as Field Size, long interger and replication Id- I choose Long Interger. Under new valuse I choose Random, under indexed I requested no duplicates.
Julie
I don't think you want to limit a key to 999 numbers. You assume that you'll never have more than that many records, but databases can and do change often, and when that happens you'll need more work to fix it.
Can I ask why you want three digit numbers? Keys should be used only for relationships from one table to another. If you want a separate number that can be random and between 0 and 1000, maybe use a different field, filled via vba?
Is your code running too slowly?
Does your workbook or database have a bunch of duplicate pieces of data?
Have a look at this article to learn the best ways to set up your projects.
It will save both time and effort in the long run!
Dave
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks