Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Generate 3 random letters 1

Status
Not open for further replies.

MrM121

Programmer
Aug 21, 2003
83
GB
Hi, can anyone please tell me the code to create 3 random letters, I can do numbers but I'm not sure about letters.

Thanks,

Nick
 
Hi MrM121

Generate a random number (between 97 and 122 for lower case letters, for example) and then use the
Code:
Chr
function to return the lower case letter that corresponds with your number.

Regards

Mac
 
ok, I get you, but how do you generate the random numbers between 97 and 122?

Thanks for you help
 
Here:
'122-97=25
c = chr(CInt(rnd() * 25) + 97)

That should do it




Clayton T. Paige
claytonpaige@yahoo.ca

Programmer Extraordinaire

========================================================

"Who is General Failure? and Why is he reading my disk drive?"
 
Thank you very Clayton, I owe you a pint! :)

Nick
 
No Prob

Clayton T. Paige
claytonpaige@yahoo.ca

Programmer Extraordinaire

========================================================

"Who is General Failure? and Why is he reading my disk drive?"
 
I don't suppose you know how to search all the fields in the Access hidden tables for a string, and then replace that string with another?

Nick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top