locked
Detect When Toggle Filter Button is Toggled RRS feed

  • Question

  • Hello,

    I need to determine when the user toggles the form's filter using Access' tool bar.  Is there an event that would allow me to do this?

    Thanks for any help!

    Wednesday, November 20, 2013 6:38 PM

Answers

  • Some more searching online this seems to be a pretty common problem. The work around would be checking the FilterOn property on the Current event, which is called every time a filter is changed in any way apparently. Thanks for the help.
    • Marked as answer by GMcElroy20 Wednesday, November 20, 2013 10:05 PM
    Wednesday, November 20, 2013 10:05 PM

All replies

  • The On Apply Filter event occurs when the user sets or removes the filter:

    Private Sub Form_ApplyFilter(Cancel As Integer, ApplyType As Integer)
        Select Case ApplyType
            Case acApplyFilter
                MsgBox "Filter turned on"
            Case acShowAllRecords
                MsgBox "Filter turned off"
        End Select
    End Sub


    Regards, Hans Vogelaar (http://www.eileenslounge.com)

    Wednesday, November 20, 2013 8:19 PM
  • Thanks for the response. I'm getting an acApplyFilter response regardless if there is or isn't a filter.
    Wednesday, November 20, 2013 9:06 PM
  • Some more searching online this seems to be a pretty common problem. The work around would be checking the FilterOn property on the Current event, which is called every time a filter is changed in any way apparently. Thanks for the help.
    • Marked as answer by GMcElroy20 Wednesday, November 20, 2013 10:05 PM
    Wednesday, November 20, 2013 10:05 PM
  • Unfortunately, the Current event does not fire when there are no records after filtering.
    Monday, November 23, 2020 12:02 AM