R
Ray S.
I have a query that returns service_type, amount, and cost_center. I want to
be able to have the user type the filtering criteria in a text box in a form.
Suppose the user wants to search for service_types that are like PC Support.
I want him to be able to type PC Support in the text box and have that be
used to filter the items in the query.
The name of the text box is STFilter.
The WHERE clause in my query reads like this:
WHERE (((DE_BG_Model.SERVICE_TYPE) Like "'" & "*" &
[Forms]![Form1]![STFilter] & "*" & "'"));
I've tried
Like Forms!Form1!STFilter
Like "*"&Forms!Form1!.STFilter&"*"
Like "'"&"*"&Forms!Form1!STFilter&"*"&"'"
Like """&"*"&Forms!Form1!STFilter&"*"&"""
and any permutation I can think of, but none returns anything. I can type
them into the immediate window while the box holds relevant information, say
PC Support.
The first returns PC Support
The second *PC Support*
The third '*PC Support*'
The fourth Run Time error 13 Type mismatch.
None works to filter anything in the query.
be able to have the user type the filtering criteria in a text box in a form.
Suppose the user wants to search for service_types that are like PC Support.
I want him to be able to type PC Support in the text box and have that be
used to filter the items in the query.
The name of the text box is STFilter.
The WHERE clause in my query reads like this:
WHERE (((DE_BG_Model.SERVICE_TYPE) Like "'" & "*" &
[Forms]![Form1]![STFilter] & "*" & "'"));
I've tried
Like Forms!Form1!STFilter
Like "*"&Forms!Form1!.STFilter&"*"
Like "'"&"*"&Forms!Form1!STFilter&"*"&"'"
Like """&"*"&Forms!Form1!STFilter&"*"&"""
and any permutation I can think of, but none returns anything. I can type
them into the immediate window while the box holds relevant information, say
PC Support.
The first returns PC Support
The second *PC Support*
The third '*PC Support*'
The fourth Run Time error 13 Type mismatch.
None works to filter anything in the query.