Applying and Clearing Filters

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cwby1966
    New Member
    • Feb 2007
    • 49

    Applying and Clearing Filters

    I have a filter that is applied on the click of a command button. If you click the button to remove the filter and show all records and then choose to do another filter with a different location you get the same data as the first time is there something I need to do duifferently
    I have included the code for both the apply filter and the show all records
    Apply
    [code=vb]
    DoCmd.ApplyFilt er "fltr_drawingsi te", ""
    Me!Floor.Requer y
    [/code]
    [Code=vb]
    Me.FilterOn = False
    Me!Combo48 = ""
    [/code]
    Clearing the filter seems to be working
    Last edited by Stewart Ross; Apr 15 '08, 09:54 AM. Reason: amended code tags
  • aprpillai
    New Member
    • Mar 2008
    • 23

    #2
    User the Filter Property of the Form to Filter Data.

    Example to Apply the Filter:

    Me.Filter = "EmployeeCo de = 1234"
    Me.FilterOn = True


    To Remove the Filter:

    Me.FilterOn = False

    will remove the filter. You can run the Code with Command Button or any other appropriate Event Procedures.

    Comment

    • cwby1966
      New Member
      • Feb 2007
      • 49

      #3
      Originally posted by aprpillai
      User the Filter Property of the Form to Filter Data.

      Example to Apply the Filter:

      Me.Filter = "EmployeeCo de = 1234"
      Me.FilterOn = True


      To Remove the Filter:

      Me.FilterOn = False

      will remove the filter. You can run the Code with Command Button or any other appropriate Event Procedures.
      Thanks for the reply I have tried that and it works exceept the criteria for the filter comes from a combo box.

      Comment

      Working...