You are here:

Using MS Access/MS Access 2007 "Like" command

Advertisement


Question
I'm putting together a class history for the first graduating class from the US Air Force Academy.  I have a query which lists names, duties and assignment locations.  I would like to search within that list for specifics, with considerations for variations on entry format.  For example I would like to use "test pilot" as the criteria and get back everyone with "test pilot", "student test pilot", "test pilot instructor", etc.  For my query criteria I tried using "Like "*enter selection criteria*", but only get back items which exactly match my request  (in my example, using "test pilot" in the like statement gives me a list of test pilots, but not students, instructors, etc.

What is the proper command to put into a query criteria to get both the selected request and items which contain the selected request and additional information?

Answer
Try:

Like "*" & [Enter selection criteria] & "*"

By including the Asterisks within the brackets you are replacing them when you enter the criteria.

P.S. Sorry to take so long to respond, I missed seeing the question.

Hope this helps,
Scott<>
Blog: http://scottgem.wordpress.com
Website: http://www.diamondassoc.com
Microsoft Access MVP 2007
Author: Microsoft Office Access 2007 VBA

Using MS Access

All Answers


Answers by Expert:


Ask Experts

Volunteer


Scottgem

Expertise

I can answer almost all types of questions relating to Microsoft Access usage and application design. My strengths are database and interface design.

Experience

I've been designing databases for over 25 years working with dBase, FoxPro, Approach and Access.

Organizations
Author of Microsoft Office Access 2007 VBA
Techncial Editor for Special Edition Using Microsoft Access 2007 and Access 2007 Forms, Reports & Queries From Que Publishing

Education/Credentials
Brooklyn College BA

©2016 About.com. All rights reserved.