Results 1 to 4 of 4
  1. #1
    wsneeden is offline Novice
    Windows XP Access 2007
    Join Date
    Mar 2014
    Posts
    4

    Filter form based on criteria from two fields

    I currently have a button set up on my main form that filters results on a subform for a specific value in a combo box. No issues getting this to work. What I want to do now is add an additional requirement to the filter that will only show 'false' values in a checkbox.

    My current code is:

    Private Sub ReceivingFilter_Click()
    Me.InspectionDetail_Subform.Form.Filter = "InspType = 'Receiving'"


    Me.InspectionDetail_Subform.Form.FilterOn = True
    End Sub

    I've tried multiple things to add in the additional checkbox filter but nothing seems to work. Any suggestions?

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    It would help if you posted what you tried. Basically you need to add

    And OtherField = False

    inside the quotes.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    wsneeden is offline Novice
    Windows XP Access 2007
    Join Date
    Mar 2014
    Posts
    4
    I've tried adding an 'AND' statement like the one below. It returns a 3075, missing operator error. Not sure what I am missing here.

    Private Sub ReceivingFilter_Click()
    Me.InspectionDetail_Subform.Form.Filter = "InspType = 'Receiving' AND Complete? = 'False'"
    Me.InspectionDetail_Subform.Form.FilterOn = True
    End Sub

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    For starters, the field with the inadvisable symbol needs to be bracketed. Also, I didn't have any quotes around False.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 2
    Last Post: 10-03-2013, 02:02 PM
  2. Replies: 1
    Last Post: 10-29-2012, 08:15 AM
  3. Replies: 9
    Last Post: 06-12-2012, 10:22 PM
  4. Replies: 2
    Last Post: 07-01-2010, 02:53 PM
  5. Replies: 1
    Last Post: 02-03-2010, 08:17 AM

Tags for this Thread

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