Hi everyone. I'm a newbie at vb and have to write a program using 2 arrays,one with student names and the other with student scores.I have to 1st print them out in original order and then sort them from best score to worst. I'm trying to do this using a list box,with a for/next loop and additem. Below is my current code. I know it is wrong and keep getting invalid qualifier errors.Any help would be greatly appreciated.
Option Explicit
Dim namearray(6) As String
Dim lstnamearray As Integer
Dim i As Integer
Private Sub Command1_Click()
Dim i As Integer
i = lstnamearray
lstnamearray.Clear
lstnamearray(0).AddItem = "Dan Pickett 92"
lstnamearray(1).AddItem = "Betty Knapp 87"
lstnamearray(2).AddItem = "Jackie Denhoff 82"
lstnamearray(3).AddItem = "Mike Diebold 78"
lstnamearray(4).AddItem = "Rob Wardell 73"
lstnamearray(5).AddItem = "Mike Garcia 70"
lstnamearray(6).AddItem = "Paul Martinez 66"
Cls
For i = 0 To UBound(namearray)
Print namearray(i)
Next i
End Sub