if i want to display a random integer from 1 - 999 then what kind of code should i do...
Text1.Text = ...............?
Printable View
if i want to display a random integer from 1 - 999 then what kind of code should i do...
Text1.Text = ...............?
I put this code in a new project, its also assuming you have a text box named Text1.
Hope this helps.Code:Private Sub Form_Load()
Randomize
Text1.Text = Int((999 * Rnd) + 1)
End Sub
Michael
put randomize in form load
and use:
:)Code:text1.Text = int(rnd * 999) + 1