Generating Random Numbers and Letters in Access

  • Thread starter Thread starter BillyBob
  • Start date Start date
B

BillyBob

Is there a method to populate a field with random numbers
(preferably letters, but numbers will do) in Access XP?
Can't seem to find anything in the books or help.
Thanks.
 
Is there a method to populate a field with random numbers
(preferably letters, but numbers will do) in Access XP?
Can't seem to find anything in the books or help.
Thanks.

The Rnd() function returns a random double float between 0 and 1. Are
you creating new records, or updating a field in existing records? Do
you want... what? a random number between 1 and 10? a random text
string between AAAAAAAA through GHKZABBQ to ZZZZZZZZ? or what?
 
What I want to do is populate a field in an existing row
with a 4 character random letter between AAAA and ZZZZ.
Thats all I need.

Try updating to:

Chr(65 + CInt(26*Rnd()) & Chr(65 + CInt(26*Rnd()) & Chr(65 +
CInt(26*Rnd()) & Chr(65 + CInt(26*Rnd())
 
Back
Top