• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 19
  • Last Modified:

Cannot enable Apply Filter / Sort button

My form has no toolbar visible (by design)
I have a Command Button that activates Filter By Form (works fine)
My Apply Filter / Sort Command Button is greyed out and I cannot enable it.

Any ideas ?

Runtime Error 2448
0
Eirman
Asked:
Eirman
4 Solutions
 
Gustav BrockCIOCommented:
It doesn't work that way. When you set the form in "Search by form" mode, everything else is disabled.
So use the band to activate the search.
0
 
mbizupCommented:
As Gustav said, the filter by disables everything, including the vba event procedures behind controls that appear active (so you cant even use the click event of a textbox disguised as a command button).  The only alternative to toolbars/ribbons when using Filter By Form is to train the users to use the built-in right click menu (if you don't have that disabled as well).

Alternatively, design a dedicated custom filter form.
0
 
EirmanChief Operations ManagerAuthor Commented:
so you cant even use the click event of a textbox disguised as a command button
I had already tried that!

Would a temporary Pop-Up form with three buttons work?
  • FILTER BY FORM
  • APPLY FILTER
  • CLEAR ALL FILTERS
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
Dale FyeCommented:
If I need to be able to filter by more than a couple of fields (which I can place in the form header), I will generally create  a popup form with all of those fields, and two buttons, Cancel and Apply Filter.  Then, I use the "On Filter" event of the main form to enable / disable the Clear Filter button on that main form.  

So, the main form would have buttons Filter (which raises the popup) and Clear Filter.  And the popup form has buttons Cancel and Apply Filter.  Of course, that Apply Filter button now has to have a bunch of code behind it to build the filter that the FilterByForm does for you.
0
 
mbizupCommented:
>> Would a temporary Pop-Up form with three buttons work?

Unfortunately not... since the commands apply to the currently active form.  It would be trying to apply the filter to your popup.

Helen Fedemma has a fairly elaborate custom filter example.  Look at sample 129, Fancy Filters, here:

http://www.helenfeddema.com/Access%20Archon.htm
0
 
EirmanChief Operations ManagerAuthor Commented:
Many Thanks

I'll probably use a custom toolbar in the short term and develop a separate search form
0
 
EirmanChief Operations ManagerAuthor Commented:
Toolbars & QAT are still hidden. I settled for this ...

FILTER BY FORM ............... Command Button > DoCmd.RunCommand acCmdFilterByForm
APPLY FILTER .................... Right Click on Form > Apply Filter/Sort
CLEAR ALL FILTERS ........... Command Button > DoCmd.RunCommand acCmdRemoveAllFilters

EDIT: This is better than acCmdRemoveAllFilters as it produces no errors if there is no filter in place.
Me.FilterOn = False
Me.Refresh

Open in new window

1

Join & Write a Comment

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now