LIKE Condition

  • Thread starter Thread starter Public
  • Start date Start date
P

Public

Hi,
I am trying to incorporate LIKE condition into my query. What I want is like
when the user enters the first characters of the course and hit search, it
will display all the courses beginning with those characters. I have tried to
use LIKE as follows

LIKE '%[Forms]![CourseSelection]![Courses]'

However, it didn't work.
Any ideas?

Regards
 
Try:
LIKE '%' & [Forms]![CourseSelection]![Courses]

Unless you are connected to another db or using ANSI Standard mode, use *
rather than % as the wildcard.
 
Thanks but it didn't work.

Regards

Allen Browne said:
Try:
LIKE '%' & [Forms]![CourseSelection]![Courses]

Unless you are connected to another db or using ANSI Standard mode, use *
rather than % as the wildcard.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Public said:
I am trying to incorporate LIKE condition into my query. What I want is
like
when the user enters the first characters of the course and hit search, it
will display all the courses beginning with those characters. I have tried
to
use LIKE as follows

LIKE '%[Forms]![CourseSelection]![Courses]'
 
Two things. If you want to match the beginning of the field, then the
wild card should be concatenated (added on) at the end of the input not
at the beginning.

LIKE Forms!CourseSelection!Courses & '%'

Also, if you may need to use "*" as the wildcard character instead of
"%". Depends on whether you are using ANSI standard SQL or not.



'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================
 
Back
Top