Results 1 to 3 of 3
  1. #1
    simon123 is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    12

    Using a checkbox to filter out a specific record

    Hi there,


    I have done a lot of googling but I can't quite find what I need.

    I have a multiple items form, which displays a list of outstanding enquiries. I have been asked to add a checkbox which can show/hide a particular organisation.

    Click image for larger version. 

Name:	Capture.PNG 
Views:	14 
Size:	12.3 KB 
ID:	35668

    So basically, if you remove the check, it hides all instances of "McDonald's" in that particular field, so we can view the results with and without that particular company. Is this straightforward? And is it possible to ensure the box is checked when the form is loaded?

    Thank you for your help

    simon
    Last edited by simon123; 10-02-2018 at 07:14 AM.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    you can use a check box for 1 company, or use a combo to pick any company:

    Code:
    sub chkBox_Afterupdate()
       Me.Filter = "[CoName]<>'McDonalds'"
       Me.FilterOn = chkBox.value
    end sub
    'combo
    Code:
    sub cboBox_Afterupdate()
    If IsNull(cboBox) Then
      Me.FilterOn = False
    Else
      Me.Filter = "[CoName]<>'" & cboBox & "'"
      Me.FilterOn = True
    End If
    end sub

  3. #3
    simon123 is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    12
    Brilliant, you're a superstar.

    Thanks.

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

Similar Threads

  1. Replies: 3
    Last Post: 11-28-2016, 03:17 PM
  2. Checkbox filter
    By cbende2 in forum Access
    Replies: 2
    Last Post: 05-27-2015, 07:20 AM
  3. Replies: 9
    Last Post: 02-24-2015, 11:19 AM
  4. Checkbox Filter?
    By 82280zx in forum Forms
    Replies: 7
    Last Post: 03-14-2014, 10:35 AM
  5. login form and filter to specific record
    By mikael in forum Programming
    Replies: 1
    Last Post: 04-10-2013, 12:02 PM

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