Hi!!!
I'm having hard time in manipulating a combo box with list view. For example if the selected index in the combo box is "boy" then the list view will display a database table allotted for boys and if the selected index is "girl" then the list view will display the database table allotted for girls.
I have this codes for adding items in the combo box and placed it in Form1_Load:
comBoxYLevel.Items.Add("Boy")
comBoxYLevel.Items.Add("Girl")
I'm using this codes to select the database:
Private Sub retBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles retBtn.Click
Select Case comBoxYLevel.SelectedIndex
Case 0
strsql = "select * from boys"
Case 1
strsql = "select * from girls"
End Select
fillListView()
End Sub
Unfortunately, the result of these codes is: the list view will successfully display the first selected case but once I select another case from the combo box, the first selected case is still there together with the second one, and so on. I want to display only what is selected, not including the previous one... How will I do it?
any response is well appreciated :)