?
Solved

Filter using like

Posted on 2007-08-08
3
Medium Priority
?
184 Views
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 & "'"
        Form12.Show()
        Me.Close()
0
Comment
Question by:wiswalld
3 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 19653706
Try this:

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

Bob
0
 
LVL 48

Accepted Solution

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

Author Comment

by:wiswalld
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.
0

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