Code Examples For RunCommand Constants

Toggle Filter

acCmdCreateShortcut

This routine allows you to turn an existing Filter On and Off. There are a number of steps required to ensure this example works.

  1. Add the code to a module
  2. Add a buttons to a toolbar
  3. Set ther action for the new toolbar item to
    =TBToggleFilter()
'***************** Code Start *******************

Function TBToggleFilter()
    DoCmd.RunCommand acCmdToggleFilter
End Function

'****************** Code End ********************