• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 472
  • Last Modified:

Filtering using "contains"

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
LiamMcKay
Asked:
LiamMcKay
  • 2
  • 2
1 Solution
 
mbizupCommented:
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
 
Leigh PurvisDatabase DeveloperCommented:
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
 
Leigh PurvisDatabase DeveloperCommented:
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
 
mbizupCommented:
*Lol!*
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.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now