Set a filter when user clicks ShowAllRecords icon

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • landolakes
    New Member
    • Aug 2007
    • 4

    Set a filter when user clicks ShowAllRecords icon

    Hi All,
    Just joined this community, hope someone can help. I have a form (just a main form, no sub form), and the user selects a work order in a combo box at the top, and the form filters on this value. the user may further filter other fields by clicking in the field then using the Filter By Selection icon along the top, and when they're done, they click the Show All Records icon. I see that the ApplyFilter event fires on this, and the FilterType is set to acShowAllRecord s. That's great, but I want to code it so it goes back to the filter on just the selected work order, not showing all records. How can I do this most efficiently? It doesn't work when I just reset the filter in that event.

    Thanks!
  • landolakes
    New Member
    • Aug 2007
    • 4

    #2
    Never mind everyone. I solved it myself. This is the ApplyFilter event:

    Private Sub Form_ApplyFilte r(Cancel As Integer, ApplyType As Integer)
    If ApplyType = acShowAllRecord s Then
    If Me.SelectWorkor der > "" Then
    Me.Filter = "WONumber = '" & Me.SelectWorkor der & "'"
    Cancel = True
    End If
    End If
    End Sub

    Comment

    Working...