NOTE: See updated code below. I recommend using the updated class module that @arnelgp modified. It further simplifies building a search form and addresses some bugs...
see in my attached form, I or user can put any comment to the record, then we can filter for the same comment, say "frequently used", I can filter using filter menu on the ms access ribbon, for all records with frequently used. But since I will not show full menu to users on the front end that I will distribute to them. How can I make a filter that can reach that purpose.
So the example is how to filter like the ribbon. In my example I used the FilterMenu but you want a Docmd.RunCmd FilterBySelection. I do not think I would ever build an interface like that because filtering a form by selection in single form view makes little sense to me. I would probably have other filter interfaces. However, this demonstrates what you asked if you can do a filterbyselection like the menu.
I reused the same data set and not very good for demonstrating. Filter on supplier name since that repeats.