teknophile
Programmer
Private Sub Command1_Click()
Dim i, a, x As Integer
Dim array1(1 To 49) As Integer
rsControls.MoveFirst
For x = 1 To 49
array1(x) = array1(x) + 1
Next
Do While Not rsControls.EOF
rsControls.MoveFirst
For a = 1 To 49
For i = 1 To 49
******* If rsControls.Fields("No1" = i Then <Here I get an error. record is not there or something. The database is ok and the record is there.
******
array1(i) = array1(i) + 1
ElseIf rsControls.Fields("No2" = i Then
array1(a) = array1(a) + 1
ElseIf rsControls.Fields("No3" = i Then
array1(a) = array1(a) + 1
ElseIf rsControls.Fields("No4" = i Then
array1(a) = array1(a) + 1
ElseIf rsControls.Fields("No5" = i Then
array1(a) = array1(a) + 1
ElseIf rsControls.Fields("No6" = i Then
array1(a) = array1(a) + 1
ElseIf rsControls.Fields("Bonus" = i Then
array1(a) = array1(a) + 1
Else
rsControls.MoveNext
End If
Next i
Next a
Loop
i = 1
For i = 1 To 49
List1.AddItem (array1(i))
Next i
End Sub
Dim i, a, x As Integer
Dim array1(1 To 49) As Integer
rsControls.MoveFirst
For x = 1 To 49
array1(x) = array1(x) + 1
Next
Do While Not rsControls.EOF
rsControls.MoveFirst
For a = 1 To 49
For i = 1 To 49
******* If rsControls.Fields("No1" = i Then <Here I get an error. record is not there or something. The database is ok and the record is there.
******
array1(i) = array1(i) + 1
ElseIf rsControls.Fields("No2" = i Then
array1(a) = array1(a) + 1
ElseIf rsControls.Fields("No3" = i Then
array1(a) = array1(a) + 1
ElseIf rsControls.Fields("No4" = i Then
array1(a) = array1(a) + 1
ElseIf rsControls.Fields("No5" = i Then
array1(a) = array1(a) + 1
ElseIf rsControls.Fields("No6" = i Then
array1(a) = array1(a) + 1
ElseIf rsControls.Fields("Bonus" = i Then
array1(a) = array1(a) + 1
Else
rsControls.MoveNext
End If
Next i
Next a
Loop
i = 1
For i = 1 To 49
List1.AddItem (array1(i))
Next i
End Sub