I am trying to make wildcard expressions work for filtering . To pass
everything, I tried Filter = "strFC = '*'" but that passed nothing. I can't
find this documented. Can i use wildcards as filters?
I figured this by using "like" instead of "=" Thanks...
> I am trying to make wildcard expressions work for filtering . To pass
> everything, I tried Filter = "strFC = '*'" but that passed nothing. I can't
> find this documented. Can i use wildcards as filters?
>I am trying to make wildcard expressions work for filtering . To pass
>everything, I tried Filter = "strFC = '*'" but that passed nothing. I can't
>find this documented. Can i use wildcards as filters?
Yes, but you must use the Like operator instead of =
Note that using Like "*" will not match Null values.
It is far better to not use a filter than to use a filter
that tries to match everything.

Signature
Marsh
MVP [MS Access]
richardb - 24 Apr 2007 13:14 GMT
Marshall,
Thank you for that tip. I was trying to set up two filters, where I could
drop one part of the filter by changing its match to "*". For example,
If This_Condition then filter1 ="*"
Filter = "Var1 Like '" & filter1 & "' AND Var2 Like '" & filter2 & "'"
This would just filter on Var2.
But intead I wrote a script using IIf to build the Filter text string to
just Filter = "Var2 = '" & filter2 & "'" in the event that This_Condition
was true, which, based on your advice, is probably the better technique.
Richard B
> >I am trying to make wildcard expressions work for filtering . To pass
> >everything, I tried Filter = "strFC = '*'" but that passed nothing. I can't
[quoted text clipped - 6 lines]
> It is far better to not use a filter than to use a filter
> that tries to match everything.