Only positive values in random auto-numbers.

insixt

New member
Local time
Yesterday, 17:19
Joined
Sep 10, 2009
Messages
8
Hello all
smile.gif
.
I have a table where I would like the primary key to be automatically generated by Microsoft Access. At present I have the field set to Auto Number(Random) and Long Integer. Unfortunately this gives me both positive and negative values. How can I get Access to just return positive numbers (I do not wish for the number to be incremented - I need random.)


Thanks for reading and I hope you can help!
 
You cannot use Autonumber for this and I question why you feel you need a primary key that has random numbers but no negatives. A primary key should only be something the SYSTEM is worried about, not you or your users. You can generate anything you want to use outside of that, but the PK is really for the use of the system to maintain relationships and ensure relational integrity.
 
When you introduce ANY CONSTRAINT AT ALL into your PK, autonumber leaves the table. You are imposing (some kind of) meaning on the autonumber, which the standard Access Autonumber doesn't support.

I concur with Bob.
 

Users who are viewing this thread

Back
Top Bottom