John Gates, CISSP, CDPSE
asked on
Easiest way to generate a 6 digit random number
Looking for the easiest way to do this in vb6, thanks 8)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Private Sub Command1_Click()
Dim k As Variant
Dim l As Variant
Dim dRandNumFull As Variant
Dim dRandNumDisplay As Variant
Dim i As Variant
For i = 1 To 1000
Randomize (rnd)
k = Date * Time * 10
dRandNumFull = Format(Int(k * rnd), "000000")
dRandNumDisplay = dRandNumFull
'MsgBox dRandNumDisplay
Text1.Text = Text1.Text & dRandNumDisplay & vbCrLf
Next
End Sub
This gave the desired result!
Thanks for your help!!