MS Access SQL - Like statement with object value

brian_msbc

Registered User.
Local time
Yesterday, 21:10
Joined
Dec 12, 2016
Messages
17
I want to use this code in the rowsource for a listbox:

Code:
 SELECT DISTINCT mps.[Partner Name]
FROM MasterProfileSummary AS mps
WHERE (((mps.[Partner Name]) Like [Me]![TextSearch])) OR ((([ME]![TextSearch]) Is Null))
ORDER BY mps.[Partner Name];
But I'm getting an enter Parameter value error. I'm only assuming i'm using "Like" incorrectly. Should there be a wildcard notation? if so, how would that look?

update- I changed [ME]! to the actual form object path which solved the enter parameter value problem, but im getting no records, I think its because of the wildcard thing.
 
Thank you for the link for when and how to use [ME]!.

How do you correctly use wildcards in a like statement when referencing objects?
 
For both sides:

Like "*" & [forms]![FormName].[ControlName] & "*"
 

Users who are viewing this thread

Back
Top Bottom