Applying Wildcard for search

  • Thread starter Thread starter Participant
  • Start date Start date
P

Participant

Hi there,
i am creating a form where I have a search field. I want to be able to
search by the entire name or part of it. I have used a query that has LIKE
statement with % but it did not work for soem reason

This is the code I used
Like "Forms!MyFormName!MyTextBox%"

Any ideas?

Regards
 
Try

Like Forms!MyFormName!MyTextBox & "%"

You may need to use the asterisk as the wildcard character if you are using an
..mdb or .accdb as the database storing the data. Access (with Jet - the
native database engine) uses different wildcard characters than ANSI compliant
SQL.
Like Forms!MyFormName!MyTextBox & "*"

Also if you want to do a contains search - string is in any part of the field
Like Forms "%" & !MyFormName!MyTextBox & "%"


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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Wildcard Search in Text Field 9
Wildcard search 2
wildcard searches 2
Query wildcard symbols 4
Excel Wildcard in Excel array formula 0
list box criteria 4
Wildcard for all locations 7
Wildcard code for a query 1

Back
Top