Docmd.ApplyFilter

ted.martin

Registered User.
Local time
Today, 07:56
Joined
Sep 24, 2004
Messages
743
I want to filter a from but instead of an exact match I need it to work with LIKE as you would use within the query. The line below replacing the = with LIKE clearly does not work.

Docmd.ApplyFilter , "Company LIKE '"& strCompany & "'"

I can do it from within a query by using the criteria Like "*" & [Company] & "*" but it would be great to have one general query and let the VBA do the work.

Any suggestions please?

Thanks

Ted :cool:
 
Have a look a tthe sample database in this thread:

Search Db

There are several vb lines that deal with the LIKE statement.


HTH
 

Users who are viewing this thread

Back
Top Bottom