Negative Autonumbers

  • Thread starter Thread starter lsh2001
  • Start date Start date
L

lsh2001

Guest
I trying to create a table where the primary key is a customerID, using the autonumber function. I would like to leave the new value setting on Random, since two people may be using database. However, I'm getting a lot of negative numbers as CustomerID's. If there a way I can limit the pool of random numbers to positive only.
 
Don't worry about the negative numbers. A key is a key is a key. You just get double the random numbers.

More important is to re-seed the random numbe generator with a new number each time the program is executed, I use Now(). Otherwise, without re-seeding. your random numbers are generated starting in the same (set) sequence.
 
Pat -

If you don't re-seed the random number generator on program startup, my experience is that without a re-seed the same exact sequence of randon numbers are regenerated. I did not say

hav(e)[ing] a user controlled incrementing sequential number

I use random table keys because, from time to time, a portion of one of my databases is exported and used outside the network where additional records and modifications are generated with additions/changes being reintegrated back into the network BE. Without random keys, I'd get duplicates.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom