bindingsource.filter

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way to perform a bindingsource.filter on multiple inputs? For
example: I would like the user to be able to put something like <Smith,
Jones, Gates> into a textbox and have the datagridview filter the lastname
column to just those entries.

My code is simple right now:

dim strFilterLastName as string = me.txtbxLastName.text

me.qryWorkListBindingSource.Filter = "empnamLastName ='" & strFilterLastName
& "'"

Thank you for any advice.
 
I've been playing with the AND operator. I get a "Cannot perform 'And'
operation on system.boolean and system.string." error when I do so.

Using the code below, I'll type <Smith' AND 'Jones> into the textbox and get
the error. Note the single quotes are there for the code to interpret.
 
Neither "Smith" nor "Jones" is an expression. However, the following would
work:

LastName = 'Smith' OR LastName = 'Jones'

That is the ORing of 2 expressions.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist

A lifetime is made up of
Lots of short moments.
 
Back
Top