Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

creating random unique numbers

Forum home » Delegate support and help forum » Microsoft Access Training and help » Creating random unique numbers in access

Creating random unique numbers in access

ResolvedVersion 2010

Enzo has attended:
Visio Introduction course
Excel Advanced course

Creating random unique numbers in access

How can I auto create unuique and random reference number for records so that they are all different.

RE: Creating random unique numbers in access

Hi Enzo

As we saw on the training you can use an Autonumber field (named ID for example) and change the New Values property from Increment to Random. This produces a 10 figure random number.

As half of these numbers will be negative you can create a separate calculated field instead with the Abs function. This will make all the numbers positive.

Abs([ID])

To create a shorter number you could use

Abs(Left([ID],5))

This will create a random 5 figure number.

Doug Dunn
Best STL

Will be marked as resolved in 5 days

Notice: This is an automated message. Due to inactivity, this forum post will be marked as 'resolved' if there are no further responses in the next 5 days.

Mon 16 Dec 2013: Automatically marked as resolved.

Access tip:

Choosing data types in Access

Not sure which data type to use for your Access fields? Here are some guidelines to help you choose a data type to assign to a field.

- The Text data type can accept up to 255 characters. For information that will be recorded in paragraphs, use Memo.

- Also use Text for numbers that aren't going to be used in calculations, e.g. phone numbers.

- Use the Currency data type for monetary amounts.

- Use Date/Time for dates.

- Most other numbers can use the Number data type, but the Field Size property may have to be altered.

- For fields that have only two alternatives (yes, no) use Yes/No data type. If there is likely to be a third entry option (e.g. maybe or don't know) use Text instead.

View all Access hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.12 secs.