Can I use wildcards in a parameter search?

  • Thread starter Thread starter Piperlynne
  • Start date Start date
P

Piperlynne

I'm trying to allow the user to input a few letters to a whole word to search
a field to bring up results for a report. I have no idea how to do this
properly. I've tried going the route of doing this within separate queries,
but I'm not sure the simplest yet most effective way to do this.
 
I'm trying to allow the user to input a few letters to a whole word to search
a field to bring up results for a report. I have no idea how to do this
properly. I've tried going the route of doing this within separate queries,
but I'm not sure the simplest yet most effective way to do this.

Let's assume you wish to search a [City] field.
In the query that is used as the report's record source, as criteria
on the [City] column, write:

Like [Enter starting letters] & "*"
to return all records where the City field begins with the entered
letters.
Enter chi and cities like Chicago or Chino will be returned.

Like "*" & [Enter ending letters]
to return all records where the City field ends with the entered
letters.
Enter ord and cities like Hartford or Hanford will be returned.

Like "*" & [Enter any letters in the city] & "*"
to return records where the City field contains those letters anywhere
in the field.
Enter ort and cities like Newport or Portland will be returned.

You will be prompted for the letters.
 
Piperlynne said:
I'm trying to allow the user to input a few letters to a whole word to search
a field to bring up results for a report. I have no idea how to do this
properly. I've tried going the route of doing this within separate queries,
but I'm not sure the simplest yet most effective way to do this.


You can use a criteria similar to:

Like "*" & Forms!theform.thetextbox & "*"
or if you are still using query parameter prompts:
Like "*" & [Enter some letters] & "*"
 
Back
Top