Results 1 to 4 of 4
  1. #1
    lewis1682 is offline Advanced Beginner
    Windows 7 32bit Access 2003
    Join Date
    Aug 2013
    Posts
    37

    Filter Checkboxes

    Hey again,

    I am running a little code to filter some results on my form. I have sorted out filtering a combobox and textboxes, but not a checkbox. Here is some code I am using for a textbox:

    Code:
        If Not IsNull(Me.txtFilterPostalCode) Then        strWhere = strWhere & "([PostalCode] = """ & Me.txtFilterPostalCode & """) AND "
        End If
    At the end I have Me.Filter = strWhere

    To filter the checkbox called checkFilterAGM I have tried to use:


    Code:
    If Me.checkFilterAGM = -1 Then        strWhere = strWhere & "([AGM] Me.checkFilterAGM = true & )"
        End If
    But it didn't work. The field name is AGM. Thank you.

  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,521
    More like:


    strWhere = strWhere & "([AGM] = true)"
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    lewis1682 is offline Advanced Beginner
    Windows 7 32bit Access 2003
    Join Date
    Aug 2013
    Posts
    37
    Wow that simple, thanks for the quick reply,

  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,521
    Happy to help!
    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. limiting checkboxes
    By Sjohnson304 in forum Programming
    Replies: 5
    Last Post: 05-04-2013, 10:53 AM
  2. Filter Query based upon Checkboxes
    By olinms01 in forum Queries
    Replies: 2
    Last Post: 01-21-2013, 11:38 AM
  3. Checkboxes ?
    By Trojnfn in forum Access
    Replies: 3
    Last Post: 09-30-2011, 01:52 PM
  4. Filter records based on multiple checkboxes
    By kbremner in forum Forms
    Replies: 2
    Last Post: 01-18-2011, 10:59 AM
  5. Clear all checkboxes?
    By thekruser in forum Forms
    Replies: 2
    Last Post: 09-16-2010, 09: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