![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Hobbyist Programmer
Join Date: Jan 2005
Posts: 110
Rep Power: 4
![]() |
random numbers on form load ?_?
i used this code for random numbers when the form loads
Private Sub Form_Load()
MsgBox(Int(Rnd() * 100000))
End Sub1 and 100000. or am i doing it wrong thanks |
|
|
|
|
|
#2 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
Before that statement, use the Randomize function to seed the random number generator based on the system clock.
|
|
|
|
|
|
#3 |
|
Hobbyist Programmer
Join Date: Jan 2005
Posts: 110
Rep Power: 4
![]() |
could you explain it like in a example or something please ^^
i dont really understand i did try but couldnt get it to work sorry im a beginner >.< thanks |
|
|
|
|
|
#4 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
Sure:
Private Sub Form_Load()
' This seeds the randomizer - makes it generate random numbers based on the time
Randomize
MsgBox(Int(Rnd() * 100000))
End Sub |
|
|
|
|
|
#5 |
|
Hobbyist Programmer
Join Date: Jan 2005
Posts: 110
Rep Power: 4
![]() |
cool it works ^_^
thanks alot |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|