Filter using like

Posted on 2007-08-08
Medium Priority
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
ID: 19653706
Try this:

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

LVL 48

Accepted Solution

jpaulino earned 500 total points
ID: 19653709
Form12.VehiclefrmBindingSource.Filter = "plate like '%" & Me.TextBox1.Text & "%'"
LVL 13

Author Comment

ID: 19653766
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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 …
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Integration Management Part 2
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

839 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