|
-
Jan 11th, 2002, 03:59 PM
#1
Thread Starter
New Member
Parse result to a form
Hello all, I'm need help on getting a password generator to work, and also to send the results of that to a form... I did a combobox that displays the names of the users, I want to do something that when I select a name from the list and click go, it will automatically generate a password and attach both the username and password to a letter. Any help would be greatly appreciated. Thank you.
J
-
Jan 11th, 2002, 06:43 PM
#2
Hmm.
There are a few things that aren't clear in your post.
What kind of passwords do you want to generate? You could do something as easy as making a 6 character string of random characters with something like:
Code:
' You only need this line once in your code, usually in your form's load event:
Randomize ' Seed the random number generator.
' This routine will generate a string of random letters as long as the
' NumberOfChars parameter that's passed in.
Public Function RandomString(NumberOfChars As Integer) As String
Dim strReturn
Dim intIndex As Integer
For intIndex = 1 To NumberOfChars
strReturn = strReturn & Chr$(Int(Rnd * 26) + 65)
Next intIndex
RandomString = strReturn
End Function
You could call the routine above with something like:
Code:
' Display a string of 6 random characters:
MsgBox RandomString(6)
So, you could get the currently selected user from your combo, generate a random password for them with something like the routine above, but then I'm at a loss as to what you mean by "attach both the username and password to a letter".
Anyways,
Good luck,
Paul
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|