To run a macro when the Filter event occurs, set the OnFilter property to the name of the macro.
Remarks
You can set the Filter or ServerFilter property in a Filter macro by using the SetValue action. This enables you to customize the filter criteria that the user sees when the Filter By Form, Advanced Filter/Sort, or the Server Filter By Form window is displayed.
You can use the CancelEvent action in a Filter macro to cancel opening the filter window.