Results 1 to 2 of 2
  1. #1
    krizzyd is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Nov 2016
    Posts
    4

    Apply Filter to a Table using Combo Box

    Hello everyone, first post here!



    I'm currently designing a form that will serve as a Shift Schedule as a course project. I'm trying to put a Combo Box that will filter the table (in the form) when a value is inserted (AfterUpdate). I'm wondering if you guys know the appropriate code (in either VBA or Macro) to execute this. I've tried Googling this issue but the codes I found do not work unfortunately.

    Attached is a picture of my form. This form is a sub form for my Navigation Form. The Navigation Form will serve as the interface for the database.

    Also wanted to add that the VolunteerID fields for both the form and the table are actually auto numbered, but masked it using an expression ->[FirstName] &","&" "&[LastName], if there is a way to filter the table using the expression I've put together, I would greatly appreciate it.

    EDIT: If you enlarge the VolunteerID Combobox, you will see the names of the people under VolunteerID.

    Please help me
    Attached Thumbnails Attached Thumbnails help.PNG  

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,526
    In the AFTERUPDATE,
    Code:
    sub cboBox_afterupdate()
    If isNull(cboBox) then
       Me.filterOn= false.
    else
        Me.filter = "[id]=" & me.Id
        Me.filterOn= true.
    end if
    end sub

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

Similar Threads

  1. Apply FIlter from Combo Box
    By Trilback in forum Forms
    Replies: 1
    Last Post: 11-03-2016, 11:52 AM
  2. Replies: 2
    Last Post: 07-20-2016, 08:36 AM
  3. Filter By Form and Apply Filter Buttons
    By JustLearning in forum Forms
    Replies: 13
    Last Post: 02-18-2015, 01:01 PM
  4. Replies: 2
    Last Post: 02-25-2013, 10:47 AM
  5. How to filter dates using an apply filter code.
    By Jgreenfield in forum Reports
    Replies: 4
    Last Post: 11-15-2011, 01:38 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