Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Reports / Printing / April 2007

Tip: Looking for answers? Try searching our database.

Filter using a wild card

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
richardb - 23 Apr 2007 21:32 GMT
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?
richardb - 23 Apr 2007 21:38 GMT
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?
Marshall Barton - 24 Apr 2007 00:29 GMT
>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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.