Random Access Number

G

Guest

I would like Access to Create a Random Number (eg 1132GH667UIIP) for a
student ID tag, that creates this once a day if that record is opened. This
for for Parents to collect their children from our Sunday School. I will
print labels for the student and for the parent with the same unique daily
access number. I have a table for Student details and the names of the
parents are a column in that table. On Click in the Attendance Table I
activate a report that generates the lables (Thanks to Allen Browne.)
 
A

Allen Browne

Rnd() generates a random value between 0 and 1 (both exclusive.)

To generate a random string of alphanumeric characters, you will need to
write a function that returns characters between 48 (zero) and 90 (Z), so:
Chr(48 + Int(43 * Rnd()))

You probably want to reject characters 58 - 63.

Do that in a loop for the number of characters you need.

Don't forget to Randomize first.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top