I have a table whose ID field I want to be a random number, but it keeps posting negative numbers. Is there a way to force it to generate only positive integers?
I have a table whose ID field I want to be a random number, but it keeps posting negative numbers. Is there a way to force it to generate only positive integers?
If it's a random number why do you care?
You can use autonumber with a random option
see http://en.wikipedia.org/wiki/AutoNumber
I care because I'm using the number as a customer number that will appear on paperwork, and it doesn't really make sense to have a negative customer number.
I'd recommend you didn't do that. The autonumber field is intended for Access' use, not the user. An autonumber is essentially a unique number, but NOT NECESSARILY sequential. You could have a table for Customer numbers and assign them as you add Customers. Or you can pick a starting number, assign it to the Customer. Then next time,identify the largest Customer number in your Customer Table and increment that number and assign it to the next Customer etc. Of course you could use a custom algorithm to assign numbers, but you would have to ensure that the number to be assigned HAS NOT YET BEEN ASSIGNED. The id of the Customer record and your Customer Number are not necessarily the same field.