Results 1 to 3 of 3
  1. #1
    JimO is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    Dec 2015
    Posts
    126

    Filter 2 fields with one Button

    I have a form that I can filter with a button using the code,



    Code:
    Private Sub Idle_Click()
        Me.Filter = ""
        Me.FilterOn = False
        Me.Filter = "[StartTime] Is Null"
        Me.FilterOn = True
        Me.Caption = "Not Scheduled"
    End Sub
    This I would like add a filter for, to display data where both [StartTime] and [Progress] are Null. Each code works by themselves, I want to combine them.

    Code:
    Me.FilterOn ="[Progress] Is Null"
    I have tried a few combinations with little to no success.

    Jim O

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    'one is a filter, one is the switch that turns the filter on/off

    Me.Filter = "[StartTime] Is Null and [Progress] Is Null"
    Me.FilterOn =true

  3. #3
    JimO is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    Dec 2015
    Posts
    126
    Thank you for the response and explanation.

    That works very well. Lots to learn and sites like this really help.

    Jim O

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 11-27-2012, 07:20 AM
  2. Replies: 28
    Last Post: 03-08-2012, 06:47 PM
  3. Filter button w/ pop-up dialog?
    By 10 Gauge in forum Forms
    Replies: 1
    Last Post: 07-19-2011, 07:04 AM
  4. Replies: 10
    Last Post: 03-21-2011, 02:46 PM
  5. Filter button
    By tomeem in forum Access
    Replies: 0
    Last Post: 08-28-2009, 12:50 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums