gud day,
I have listview1 with "Category" and each category has list of Technicians.
And when Category is selected in listview1, the list of Technician should display in listview2.
I was trying with this code.
And I get error like attached.
any help please.
regards
vb kid
I have listview1 with "Category" and each category has list of Technicians.
And when Category is selected in listview1, the list of Technician should display in listview2.
I was trying with this code.
Code:
Private Sub ListView2_ItemClick(ByVal Item As MSComctlLib.ListItem)
With Me
Label3.Caption = Me.ListView2.SelectedItem.Text
End With
On Error GoTo err:
If rs.State = adStateOpen Then rs.Close
Me.ListView1.ListItems.Clear
rs.Open "Select * from tblEmp where Category" = Me.Label3.Caption, cn, adOpenKeyset, adLockPessimistic
Do While rs.EOF = False
Me.ListView1.ListItems.Add , , rs.Fields("NAME").Value
rs.MoveNext
Loop
Exit Sub
err:
MsgBox err.Description, vbCritical, "Error"
Set rs = Nothing
End Sub
any help please.
regards
vb kid