Hello. I'm pretty much new to VB and I'm currently on an IT course at college. In one of our units we are learning VB and I've been trying to do this task which has started to prove quite difficult. I've tried to seek advice and help from tutors and fellow students, but the students are quite disruptive in class except a few and our tutors just got changed.

I basically have to create a lottery program, that will have a button that creates 6 random numbers in text box lbls and a button for the bonus ball, as well as a sort button to sort the 6 numbers in ascending order. I've done all of this except, my 6 numbers sometimes turn out the same as well as the bonus ball and my reset button resets all 6 to 0.

Any help would be appreciated, as I'm really lost right now and kind of in the deep end with all this being so new to me. Heres what I have so far. I've tried variations of generating the 6 numbers but this is what I originally had.
-------------------------------------------------------------------------

Dim Values(1 To 6) As Integer

Private Sub cmdReset_Click() 'Resets lottery numbers'
lbl1.Caption = "0"
lbl2.Caption = "0"
lbl3.Caption = "0"
lbl4.Caption = "0"
lbl5.Caption = "0"
lbl6.Caption = "0"
cmdReset.Visible = False 'Reset button is invisible'
End Sub

Private Sub cmdBonus_Click()
Randomize
Dim counter As Integer
lblBonus.Caption = Int(Rnd * 16 + 1)
For counter = 1 To 6
If Values(counter) = lbl1.Caption Or lbl2.Caption Or lbl3.Caption Or lbl4.Caption Or lbl5.Caption Or lbl6.Caption Then
lblBonus.Caption = Int(Rnd * 16 + 1)
End If

Next

End Sub

Private Sub cmdBalls_Click()
Randomize
Dim counter As Integer
cmdReset.Visible = True
lbl1.Caption = Int(Rnd * 16 + 1)
lbl1.Caption = Values(1)
lbl2.Caption = Int(Rnd * 16 + 1)
For counter = 1 To 6
If Values(counter) = lbl2.Caption Then
lbl2.Caption = Int(Rnd * 16 + 1)
counter = 1
End If

Next

lbl3.Caption = Int(Rnd * 16 + 1)
For counter = 1 To 6
If Values(counter) = lbl3.Caption Then
lbl3.Caption = Int(Rnd * 16 + 1)
counter = 1
End If

Next

lbl4.Caption = Int(Rnd * 16 + 1)
For counter = 1 To 6
If Values(counter) = lbl4.Caption Then
lbl4.Caption = Int(Rnd * 16 + 1)
counter = 1
End If

Next

lbl5.Caption = Int(Rnd * 16 + 1)
For counter = 1 To 6
If Values(counter) = lbl5.Caption Then
lbl5.Caption = Int(Rnd * 16 + 1)
counter = 1
End If

Next

lbl6.Caption = Int(Rnd * 16 + 1)
For counter = 1 To 6
If Values(counter) = lbl6.Caption Then
lbl6.Caption = Int(Rnd * 16 + 1)
counter = 1
End If

Next

End Sub


Private Sub cmdSort_Click()
Dim counter As Integer
Dim sortcount As Integer
Dim sort As Integer

counter = 1
sortcount = 1

Do Until counter = 100
sortcount = 1
Do Until sortcount = 6
If Values(sortcount) > Values(sortcount + 1) Then
sort = Values(sortcount)
Values(sortcount) = Values(sortcount + 1)
Values(sortcount + 1) = sort
End If
sortcount = sortcount + 1
Loop
counter = counter + 1
Loop
lbl1.Caption = Values(1)
lbl2.Caption = Values(2)
lbl3.Caption = Values(3)
lbl4.Caption = Values(4)
lbl5.Caption = Values(5)
lbl6.Caption = Values(6)

End Sub