i cant load my data in listview
this is my code
Private Sub LoadCustomerListView()
Dim strSQL As String
Dim objCurrLI As ListItem
strSQL = "Select Lastname" _
& " , Firstname" _
& " , Address" _
& " , Idnumber" _
& " , Gender" _
& " From Student " _
& " Order by Lastname"
[B]mobjCmd.CommandText = strSQL[/B]
Set mobjRst = mobjCmd.Execute
ListView1.ListItems.Clear
With mobjRst
Do Until .EOF
Set objCurrLI = ListView1.ListItems.Add(, , !Lastname & "", , "Custs")
objCurrLI.SubItems(Firstname) = !Firstname & ""
objCurrLI.SubItems(idnumber) = !idnumber & ""
objCurrLI.SubItems(Address) = !Address & ""
objCurrLI.SubItems(Gender) = !Gender & ""
.MoveNext
Loop
End With
ListView1.ListItems.Clear
Set objCurrLI = Nothing
Set mobjRst = Nothing
End Sub
the error is "Object Variable or With Block variable not set" that is the error. .