Return wildcards in Query Criteria from Form

T

The parawon

I'm using the expression in a Query to return the data that someone will
enter into a form's text box. The criteria is returned properly and the
reports run fine when the data entry person types the exact name. For
example, if the entry person typed "Mike" in the form, the make table query
would run and return all records with Mike. If the data entry person enters
"Mi*" to get anything that sounds like Mike or Michelle, nothing no records
are returned. In the expression builder, I am only referencing the text box,
not any of it's properties. I'm simply using:
Forms![ContactPerson]![NameTextBox] in the criteria field of the make-table
query.

Any help in the right direction is appreciated.
 
R

Rick B

Don't let them enter the wildcard, just have them enter a partial name....

Like Forms![ContactPerson]![NameTextBox]& "*"




Or if you want to find the string in any position...


Like "*" & Forms![ContactPerson]![NameTextBox] & "*"



Rick B
 
J

John Vinson

I'm using the expression in a Query to return the data that someone will
enter into a form's text box. The criteria is returned properly and the
reports run fine when the data entry person types the exact name. For
example, if the entry person typed "Mike" in the form, the make table query
would run and return all records with Mike.

Ummm...

A MakeTable query is almost certainly neither necessary nor desirable
here. Are you making the very common mistaken assumption that you must
have data copied into a Table in order to generate a Report? That's
not the case; you can base a Report on a simple Select query.


John W. Vinson[MVP]
 

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

Top