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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access Randomize statement

Status
Not open for further replies.

docmeizie

Programmer
Aug 5, 2003
326
US
Does anyone think that the Randomizie statement, coupled with the rnd statement, in Access 97(shoot me for using this program) is a good random number generator for a small program????

Computers are like an array of randoms, ya never know what ya gonna get!!!
 
Hi docmeize,

Yes I have used the Randomize statement in Access97 with good results. Randomize seems to get round the problem of the same number being generated on each first run of the rnd() function. Not sure how it works. but it really does seem to randomize.

All the best,

John Davy-Bowker
www.dbLetterWriter.com
 
The Randomize statement is absolutely necessary for generating a random sequence.

The Rnd function is a routine that generates the next number using a function which among other things, is based on the previous value generated. Therefore, it is necessary to Seed the random number generator before you start a new sequence. The Randomize statement is the seeding process, and it uses both date and current time (down to milliseconds I think) to seed the generator, thus the likelihood that you'll ever seed the generator with the same value twice is highly highly unlikely. That way, you'll probably never see the same sequence twice.

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top