hi everyone!
need help in using all the listbox contents for filtering a datagridview2 (that is binded with an access database)
my code is as follows:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim tables As DataTableCollection = VPC_DatabaseDataSet.Tables
Dim view1 As New DataView(tables(4))
Dim source1 As New BindingSource()
source1.DataSource = view1
CHICK_DELIV_ORDERDataGridView.DataSource = source1
Me.CHICK_DELIV_ORDERTableAdapter.Fill(Me.VPC_DatabaseDataSet.CHICK_DELIV_ORDER)
source1.Filter = " BATCH_N = '" & TextBox1.Text & "'"
Dim view2 As New DataView(tables(3))
Dim source2 As New BindingSource()
source2.DataSource = view2
CHICK_BOXDataGridView.DataSource = source2
Me.CHICK_BOXTableAdapter.Fill(Me.VPC_DatabaseDataSet.CHICK_BOX)
source2.Filter = " CHICK_DELIV_ORDER_N = ' " & ListBox1.Text & "'"
End Sub
the listbox has the same content (chick deliv order N as in the datagridview1)
the listbox contents are numbers:
100101
100102
100103
the code above is working, however, the datagridview2 only displays only the matches for the first entry in the listbox, which is 100101. it does'nt include the matches for the other two contents in the listbox.
hope somebody can help.
thanks!