user3287552
user3287552

Reputation: 45

Combobox to filter fields in database?

How can I get the fields shown on the database to change depending on what is selected on the combobox? enter image description here Thanks

Upvotes: 0

Views: 695

Answers (1)

Nocturnal
Nocturnal

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

Related Questions