Dim x As Integer

Dim timesThrough As Integer

Dim counter As Integer

Dim number(5) As Integer

 

 

Private Sub cmdGetNumber_Click()

Repeat: 'repeat section start

Randomize Timer

x = Int(Rnd * 10) + 1

For counter = 0 To 4 Step 1

If x = number(counter) Then

GoTo Repeat 'if a dupe, repeats the section

End If

Next counter

number(timesThrough) = x

txtOutput.Text = CStr(x)

timesThrough = timesThrough + 1

If timesThrough > 4 Then

timesThrough = 0

End If

End Sub

 

Private Sub cmdExit_Click()

End

End Sub