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

VBA Rand function in Access

Status
Not open for further replies.

jjb373

MIS
Feb 4, 2005
95
US
I have an Access form with a random button on it. The Rnd function works find and does what I desire. My issue is:
When you use the random button a number of times (example 25 times) then close the form and open it again, the next 25 you choose the random button, the results seem to be the exact same as they did the previous time. In previous studies, I learned you can eliminate this continuous pattern but I don't recall the solution. Any suggestions?

Here is a small bit of my code - at least for the random process.

Dim MyValue1

MyValue1 = Int((6 * Rnd) + 1)
Die1 = MyValue1


Cheers,

JJB373
 
In the Load event procedure of the form you may call the Randomize function.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top