hi there ...a pleasant day/evening...i am wrking for a code...wat i wnt to happen s dat in the combobox category when i click all, all d items dsplay but wen i click specific category somethng went wrong with my code..i cannot view all d items under with the choosen category...pls help me...here is my code...
If cboscategory.Text = "" Then
MsgBox "Select from the category"
ElseIf cboscategory.Text = "All" Then
If rs.State = adStateOpen Then rs.Close
rs.Open "Select * from tbllistgood ", cn, adOpenKeyset, adLockPessimistic
While Not rs.EOF
With frmlist.ListView2.ListItems.Add(, , rs!category)
With .ListSubItems
.Add , , rs!code
.Add , , rs!nmeitem
.Add , , rs!rprice
End With
End With
rs.MoveNext
Wend
Else
If rs.State = adStateOpen Then rs.Close
rs.Open "Select * from tbllistgood where category like '" & cboscategory.Text & "';", cn, adOpenKeyset, adLockPessimistic
While Not rs.EOF
With frmlist.ListView2.ListItems.Add(, , rs!category)
With .ListSubItems
.Add , , rs!code
.Add , , rs!nmeitem
.Add , , rs!rprice
End With
End With
rs.MoveNext
Wend
End If
End Sub