Text Filter, Contains

Woods

New member
Local time
Today, 15:11
Joined
Jun 12, 2018
Messages
7
For the life of me, I cannot find any VBA Code that will bring up the "Custom Filter", the one that you Right click, goto "Text Filters", then to "Contains". Can someone tell me the command line to do this? Thank you in advance!:banghead:
 
You use wildcards. For example
Code:
"TextField Like '*woods*'"
Or
Code:
"TextField Like '*'  & '" & me.cboFilter & "' & '*'"
Etc
 
Thanks for the quick reply, but that does not answer my Post. I need the "Custom Filter" Dialog Box...
 
Thought the question looked too easy ...!

I'm not sure you can open that direct.
The nearest I can offer opens the filter menu which includes the contains/custom filter item

Add a button to your form & add code like this:

Code:
Private Sub cmdFilterMenu_Click()

On Error GoTo Err_Handler

    Screen.PreviousControl.SetFocus
    DoCmd.RunCommand acCmdFilterMenu

Exit_Handler:
    Exit Sub

Err_Handler:
    MsgBox "Error " & Err.Number & ": " & Err.Description
    Resume Exit_Handler

End Sub

There are other filter options:
- acCmdFilterByForm
- acCmdFilterBySelection
- acCmdFilterExcludingSelection

BUT no such thing as acCmdCustomFilter

HTH
 
Thanks for the reply. This, DoCmd.RunCommand acCmdFilterMenu, only brings up the first part. I need the Text Filters, Contains Dialog box.
 
Presumably you didn't look at it properly...?

attachment.php


Clicking any of the items in the text filters dropdown, e.g. the 'contains' menu item, opens the custom filter dialog that you want
As I said before there appears to be no direct path to the custom filter dialog.
AFAIK you can't open it direct
 

Attachments

  • Capture.PNG
    Capture.PNG
    13.5 KB · Views: 1,805

Users who are viewing this thread

Back
Top Bottom