Results 1 to 3 of 3
  1. #1
    Hursan is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2021
    Posts
    23

    Using two combo boxes to filter a split table

    I have a split form I want to filter using two Combo Boxes:
    First by Department (DepartmentCombo) then by Date (JulianComboBoX). When I select a department from the DepartmentCombo, I see my filtered options under the JulianComboBox, but when I select a date from the JulianComboBox, the list unfilters the Departments and shows me everything that matches the JulianComboBox selection.

    For example, when I select department HOS from the DepartmentCombo the JulianDateCombo shows me a filtered list, but when I select let’s say date 262, the split table refreshes and shows me everything that matches date 262 from all departments not just from department HOS.

    This is the DepartmentCombo Query/RowSource
    SELECT ListByDepartmentQuery.Dept
    FROM ListByDepartmentQuery


    GROUP BY ListByDepartmentQuery.Dept, ListByDepartmentQuery.Dept
    ORDER BY ListByDepartmentQuery.Dept;

    This is the Private Sub DepartmentCombo_AfterUpdate()
    Me.Filter = "[Dept]= " & Chr(34) & Me.DepartmentCombo & Chr(34)
    Me.FilterOn = True

    This is the JulianComboBox Query/RowSource
    SELECT ListByDepartmentQuery.Dept
    FROM ListByDepartmentQuery
    GROUP BY ListByDepartmentQuery.Dept, ListByDepartmentQuery.Dept
    ORDER BY ListByDepartmentQuery.Dept;

    This is the Private Sub JulianComboBoX_AfterUpdate()
    Me.Filter = "[JulianDate]= " & Chr(34) & Me.JulianComboBoX & Chr(34)
    Me.FilterOn = True
    Me.DepartmentCombo.Requery

    Any help is greatly appreciated. Thanks in advance

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    5,036
    So you need to combine the filters, not swap one for the other?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,973
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Split form with Combo boxes
    By carmenv323 in forum Forms
    Replies: 3
    Last Post: 01-24-2022, 02:14 PM
  2. Replies: 5
    Last Post: 04-22-2021, 09:00 AM
  3. Replies: 27
    Last Post: 10-30-2019, 01:27 PM
  4. Split form filter via combo boxes
    By killermonkey in forum Forms
    Replies: 3
    Last Post: 03-21-2013, 12:37 PM
  5. Replies: 1
    Last Post: 04-27-2010, 09:30 PM

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