|
-
Mar 22nd, 2007, 03:39 PM
#1
Thread Starter
Fanatic Member
[RESOLVED] Generating Random Numbers in VB6
For a project I have currently done, I have designed a database that contains a table, which contains the field "NHS Number". People in the UK would know that this is a unique ten digit number.
I am in the process of adding "people" into the database for testing purposes.
In real life, different people would have totally different NHS Numbers, so using AutoNumber is totally out of the question. So I have to have a random number...
I have currently made a random integer generator to solve this problem... or so I thought 
Using the following code:
vb Code:
Private Sub Command1_Click()
Dim dblRand As Double
Dim strRand As String
dblRand = Int(Rnd * 10000000000#)
Text1.Text = dblRand
Clipboard.Clear
strRand = dblRand
Clipboard.SetText strRand
End Sub
Using the command doesn't acutally generate a random number each time for me. While I'm running the program, it generates random numbers, fair enough. When I start the program again, it generates the same random numbers it did before 
Is there something I've done wrong? Is there another way to randomise numbers?
Thanks
-
Mar 22nd, 2007, 03:44 PM
#2
Thread Starter
Fanatic Member
Re: [RESOLVED] Generating Random Numbers in VB6
Done a VBF search: Answer
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
|