Hi again,
Hopefully a quick one, I have an unbound form that is used to specify certain criteria for a query. There are up to twelve different fields that a user can enter criteria into, or they can leave some of them blank if need be and the query will ignore them. This is perfect when I'm searching for exact matches, but in one particular field (a memo field called 'Notes') the user is more likely going to enter in one or two key words as a string they want the query results to contain.
The relevant portion of my SQL query looks like this
WHERE...
...
And ((Contacts.Notes) Like "*" & forms![General Query]!Notes & "*" Or forms![General Query]!Notes Is Null));
You can see I've attempted to include the wildcard "*" but I'm getting no results when I run the query. Whereas if I change the SQL to this;
WHERE...
...
And ((Contacts.Notes) Like "*" & [Insert String Here] & "*" Or forms![General Query]!Notes Is Null));
- Access pops up with a separate box asking for the string in the 'Notes' field, which I enter in, and it works. Ideally I don't want the second box to pop up, I just want to feed my search string into my unbound form and away we go.
Any ideas where I'm going wrong?
Thanks for your help!
Hopefully a quick one, I have an unbound form that is used to specify certain criteria for a query. There are up to twelve different fields that a user can enter criteria into, or they can leave some of them blank if need be and the query will ignore them. This is perfect when I'm searching for exact matches, but in one particular field (a memo field called 'Notes') the user is more likely going to enter in one or two key words as a string they want the query results to contain.
The relevant portion of my SQL query looks like this
WHERE...
...
And ((Contacts.Notes) Like "*" & forms![General Query]!Notes & "*" Or forms![General Query]!Notes Is Null));
You can see I've attempted to include the wildcard "*" but I'm getting no results when I run the query. Whereas if I change the SQL to this;
WHERE...
...
And ((Contacts.Notes) Like "*" & [Insert String Here] & "*" Or forms![General Query]!Notes Is Null));
- Access pops up with a separate box asking for the string in the 'Notes' field, which I enter in, and it works. Ideally I don't want the second box to pop up, I just want to feed my search string into my unbound form and away we go.
Any ideas where I'm going wrong?
Thanks for your help!