Hi, and thanks for reading, I only hope you have a chance of helping me out, whoever you may be i thank you in advance.
Here is the problem I am up against.
My program is random number selector like a lottery number picker. I made it so it picks all the numbers and each is randomized. But of course as each number is random, it means sometimes the numbers turn out the same.
If i used 6 numbers for example, 1,2,3,4,5,6 like the lotto. Numbers 1 and 6 may generate the same number. I would like to make it so the program knows it has already selected a number and not to select the same number number again in that line. I hope this makes sense. A part of the code that is relavent is below and this is the exe file http://www.andoverhydroponics.co.uk/Lottery.zip
Sorry for posting the link, but the upload file to attatch on the forum did not work.
Any tips would be great Thanks. Bill
Private Sub cmdLotto_Click() lblLotto1.Caption = Str(Int(Rnd * 49) + 1) lblLotto2.Caption = Str(Int(Rnd * 49) + 1) lblLotto3.Caption = Str(Int(Rnd * 49) + 1) lblLotto4.Caption = Str(Int(Rnd * 49) + 1) lblLotto5.Caption = Str(Int(Rnd * 49) + 1) lblLotto6.Caption = Str(Int(Rnd * 49) + 1) End Sub