Full Version: 'Filter by selection' and 'remove filter'
UtterAccess Forums > Microsoft® Access > Access Forms
These are 2 buttons on the standard toolbar, but I want them as command buttons on my form. However the wizard for creating a command button doesn't include these options.
Any ideas?
The wizard does include FilterBy selection.
However, the code produced by FilterBySelection doesn't work.
You can use:
DoCmd.RunCommand acCmdFilterBySelection
To remove the filter use:
DoCmd.RunCommand acCmdRemoveFilterSort
Thanks a lot.
Why doesn't the code work with the wizard?
In my version of Access (97), the available Categories in the wizard are:

Record Navigation
Record Operations
Form Operations
Report Operations

Only Form Operations mentions filters. Available are:

Apply Form Filter
Edit Form Filter

Is one of these the same as Filter by Selection?
OK - maybe FilterByException came later - I didn't know that.
But it doesn't work because it doesn't put the focus back onto the control that has just lost focus to get to the button.
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.