H
HanSolo
Hey folks,
I'm attempting to use a random password generating function in a query,
but when running the query, the function is only called once. This
results in the same random password for all of my rows. Can anyone
help me to get the function to loop for each row (resulting in a
different random password in each row)? It's okay if I get duplicates
if it doesn't happen often.
Thanks and here's the current state of the random password generating
function:
Public Function fPasswordGenerator() As String
Dim intLoop As Integer
Dim strChar As String
Dim strDummy As String
strChar = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"
Randomize
For intLoop = 1 To 6
strDummy = strDummy & Mid(strChar, Int(Rnd * Len(strChar)) + 1,
1)
Next intLoop
fPasswordGenerator = strDummy
fExit:
On Error Resume Next
Exit Function
End Function
I'm attempting to use a random password generating function in a query,
but when running the query, the function is only called once. This
results in the same random password for all of my rows. Can anyone
help me to get the function to loop for each row (resulting in a
different random password in each row)? It's okay if I get duplicates
if it doesn't happen often.
Thanks and here's the current state of the random password generating
function:
Public Function fPasswordGenerator() As String
Dim intLoop As Integer
Dim strChar As String
Dim strDummy As String
strChar = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"
Randomize
For intLoop = 1 To 6
strDummy = strDummy & Mid(strChar, Int(Rnd * Len(strChar)) + 1,
1)
Next intLoop
fPasswordGenerator = strDummy
fExit:
On Error Resume Next
Exit Function
End Function