Hey all.
I'm designing a form wherein a datagrid is being filtered from numerous controls.
The issue im having is each filter overrides the previous one. Just wondering the best way to approach this problem.
Heres a snippet of my code:
With the result: http://i53.tinypic.com/2w7hdns.jpgCode:Private Sub MakeIDComboBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MakeIDComboBox.SelectedIndexChanged Sheet1BindingSource.Filter = "Make like '" & MakeIDComboBox.SelectedItem & "'" End Sub Private Sub turboCheck_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles turboCheck.CheckedChanged If (turboCheck.Checked = True) Then Sheet1BindingSource.Filter = "Turbo like '" & "Y" & "'" End If
(it should only show turbo aflas)
I've tried a variety of other approaches to no avail including
(syntax errors)Code:Private Sub turboCheck_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles turboCheck.CheckedChanged If (turboCheck.Checked = True) Then Sheet1BindingSource.Filter = "Turbo like '" & "Y" & "'" & "Make like '" & MakeIDComboBox.SelectedItem & "'" End If
and
(one still overrides the other)Code:Private Sub turboCheck_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles turboCheck.CheckedChanged If (turboCheck.Checked = True) Then Sheet1BindingSource.Filter = "Turbo like '" & "Y" & "'" Sheet1BindingSource.Filter = "Make like '" & MakeIDComboBox.SelectedItem & "'"
I'm really new to this so I'm sure the solution is probably rather simple
Would love some help here thanks!



Reply With Quote


