Filter using like

Posted on 2007-08-08
Last Modified: 2012-05-05
I am trying to open a form a filter using a like statement. I use this for a regular filter. How do I add the like?

Form12.VehiclefrmBindingSource.Filter = "plate = '" & Me.TextBox1.Text & "'"
Question by:wiswalld
    LVL 96

    Expert Comment

    by:Bob Learned
    Try this:

    Form12.VehiclefrmBindingSource.Filter = String.Format("plate Like '{0}*' ", Me.TextBox1.Text)

    LVL 48

    Accepted Solution

    Form12.VehiclefrmBindingSource.Filter = "plate like '%" & Me.TextBox1.Text & "%'"
    LVL 13

    Author Comment

    Thanks jpaulino just what I was looking for. Allows me to use any part of the field.

    TheLearnedOne: worked but only matched the first part of the field.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
    Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now