I made this simple Virtual Lottery Game, everything works out fine except the comparision of the Randomly Generated Numbers with Numbers entered into the Text Boxes.
So here's the concept, the user fills in six Input Fields with numbers between 1 and 49 (here defined as Text1(0) - Text1(5) Control Array), the numbers generated randomly are displayed in the Labels defined as Label1(0) - Label1(5) Control Array, and to show the numbers that match I deceided to put another Label Control Array named as Label2(0) Label2(5) which main purpose is to simply show a "+" below the matching number.
So here's the problem, I tried every possible Loop but it still doesn't show the "+" below the matching numbers. I tried to define the variables as static and integer but I'm still not smarter than I was before.
I have pasted the code below
[code]Private Sub Command1_Click()
Static i As Integer
Static j As Integer
Static k As Integer
Static l As Integer
Static random As Integer
For i = 0 To 5
If (Val(Text1(i).Text) >= 1 And Val(Text1(i).Text) <= 49) Then
For j = 0 To 5
random = Int((Rnd() * 49) + 1)
Label1(j).Caption = random
'This is where my problems start...
For k = 0 To 5
If (Val(Text1(j).Text) = Val(Label1(j).Caption)) Then
Label2(j).Caption = "+"
MsgBox ("Not Valid " &i)
Thanks in advance...