?
Solved

Filtering using "contains"

Posted on 2006-11-09
4
Medium Priority
?
466 Views
Last Modified: 2010-05-18
I have a database table in Access 2003.  I have a column that has data like this:

HC, IC, HP, PO
IC, PO, EM
IC,
EM, PO, WE

What I need to do is filter the table to show all records containing HC or PO or EM

0
Comment
Question by:LiamMcKay
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 61

Expert Comment

by:mbizup
ID: 17905438
Hi LiamMcKay,

Try using like:

me.filter = "[YourField] LIKE '*HC*' OR [YourField] LIKE '*PO*' Or [YourField] LIKE '*EM*'"

(replace YourField with the application specific name)

0
 
LVL 44

Accepted Solution

by:
Leigh Purvis earned 225 total points
ID: 17905460
If they're all definitely only two characters then that should be all you need.
Often when that isn't the case it's a good idea to include the commas - to make sure you're hitting a string inside another :-)
0
 
LVL 44

Expert Comment

by:Leigh Purvis
ID: 17905630
lol - umm I think you missed?
I was just passing the time of day - stood here leaning on the metaphorical lamppost.

Miriam's Q surely.
0
 
LVL 61

Expert Comment

by:mbizup
ID: 17905688
*Lol!*
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Suggested Courses

801 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