Is there a way to make a list box appear when using "Like" in the criteria of a query? The user currently has to type in the data to query on. I would like them to be able to pick from a list.
Hi,
It should be as follows:
Like "*" & [forms]![Cutting]![Cutting1] & "*"
The * is used as a wildcard character. So, if a user were to enter "ABC", the result being sent into the criteria would be "*ABC*". HTH,
Randy Smith
California Teachers Association
Randy is correct, if you want to find all rows with ABC anywhere in the given column, but if you want to find (say) only those beginning ABC, then you need ABC* ie
Like [forms]![Cutting]![Cutting1] & "*"
out of interest you can also use ? to repesent a single wildcard character.
But to your question:
"I get a message saying the expression is typed incorrectly or is too complex to be evaluated."
You refer to the control as a listbox, is it a list box or a combo box?
If it is a list box, is it a simple list box (ie you can select only one item)?
Are you confident the problem lies with the criteria portio of your query,
Try the query without a criteria, does it work?
Try the query with a 'hard coded' criteria (eg Like ABC*), does it work?
Regards
Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now -
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.