Reputation: 45
How can I get the fields shown on the database to change depending on what is selected on the combobox? Thanks
Upvotes: 0
Views: 695
Reputation: 386
many ways to do this but i guess bindingsource would be the easiest.
just bind the grid to your datasource using a Bindingsource
then u can filter like
MyBindingSource.Filter = "Forename = Walter"
so with your Combobox it should look like
MyBindingSource.Filter = "Forename = " & ComboBox1.SelectedValue & ""
and to clear the filter
MyBindingSource.RemoveFilter()
Upvotes: 1