Ryan
2012-05-22 10:24:47 UTC
I have a database with two items in it. Those items could be "Sky", and "Ski", for example.
I have a textbox with a "Filter" button beside it. When the button is pressed, I would like for the database grid view to show ALL results that CONTAIN the word(s) in the textbox.
Let's say I type "Sk" in the text box. I would like both "Sky" AND "Ski" to be displayed, because they both contain the "Sk" that was typed in the text box. Of course, if I type "Sky" in the text box, only "Sky" should be displayed in the grid view of the database.
I have not been able to find a good, simple way to do this, and I know there must be one out there.
Example code:
The code that I am using is as follows (this one is just an example):
Me.ExampleCodeBindingSource.Filter = "ItemName = '" & Me.TextBox1.Text & " ' "
This code ONLY displays results in the grid view that match EXACTLY what is in the textbox. Any thoughts on how to find results that CONTAIN the textbox word(s) in them?
Thanks!