GIANTOCR
asked on
Create a Binding Source Filter in Visual Basic
I have a visual basic 2005 form, Form1, with 20+ controls(textboxes, comboboxes) on it, each bound to a column in an ms access table DataPoints. The controls are bound using tableadapter taDataPoints and BindingSource bsDataPoints.
The form also has a BindingNavigator, bnDataPoints. I would like to add a button to the BindingNavigator that will allow the user to filter by the text selected in the active control.
For example; textbox1 is bound to the column DataPointName, the user selects the text "SteamPressure" in textbox1 and clicks the filter button on the Bindingnavigator. I would like the code to build the statement "DataPointName='SteamPress ure'", which will be used as the filter in the BindingSource.
Does anyone have any code that can write a Filter statement for the binding source by detecting which column in the table the active control is bound to? I am having trouble picking up the bound-to column from the control.
Any help would be appreciated. Thanks,
John
The form also has a BindingNavigator, bnDataPoints. I would like to add a button to the BindingNavigator that will allow the user to filter by the text selected in the active control.
For example; textbox1 is bound to the column DataPointName, the user selects the text "SteamPressure" in textbox1 and clicks the filter button on the Bindingnavigator. I would like the code to build the statement "DataPointName='SteamPress
Does anyone have any code that can write a Filter statement for the binding source by detecting which column in the table the active control is bound to? I am having trouble picking up the bound-to column from the control.
Any help would be appreciated. Thanks,
John
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.