Results 1 to 8 of 8
  1. #1
    Droups is offline Novice
    Windows 11 Office 365
    Join Date
    Apr 2025
    Posts
    2

    Access form filter

    I would really need help figuring out how to set a filter on a combobox.

    Let me explain my situation:

    I have an Access database to manage services provided by a firm.

    I’m using 5 tables to manage these services — you can find them attached.



    In my form, to insert a new service, I use a combobox called cmbPrestazioni.

    Its rowsource is:

    SELECT Anagrafica_Prestazioni.ID_Prestazione, Tipo_Macro & ' - ' & Desc_Prestazione AS VoceCompleta
    FROM Anagrafica_Prestazioni
    ORDER BY Anagrafica_Prestazioni.Tipo_Macro, Anagrafica_Prestazioni.ID_Prestazione;

    With 2 columns: 0cm;7cm.

    What I would like to achieve is allowing the user to filter the possible results while typing in the combobox.

    For example: if the user types “Ass”, I would like the combobox to show all records where either Desc_Prestazione or VoceCompleta contains the consecutive letters “Ass” (case insensitive).

    If the user deletes a letter, the filter should update accordingly.
    If the combobox is empty, then the rowsource should return to the original unfiltered query.

    Can someone help me?

  2. #2
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,820
    Can you upload your database?

  3. #3
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,556
    Likely need to use the change event and only apply filter if there is a value in the combo.
    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

  4. #4
    jojowhite's Avatar
    jojowhite is online now Competent Performer
    Windows 11 Access 2021
    Join Date
    Jan 2025
    Posts
    434
    Here test this, if this is what you need.
    Attachment 52956
    Attached Files Attached Files
    Last edited by jojowhite; 04-10-2025 at 01:18 AM.

  5. #5
    Droups is offline Novice
    Windows 11 Office 365
    Join Date
    Apr 2025
    Posts
    2

  6. #6
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,556
    I entered over 23K records using a combo for the data.
    here is one for the crew
    Code:
    SELECT Crew.ID, Trim([surname] & " " & [initials]) AS Name, Crew.CrewDept, Crew.Cabin
    FROM Crew
    ORDER BY Trim([surname] & " " & [initials]);
    As I typed in the name, it automatically located the record(s) or ran the NotinList event.
    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

  7. #7
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Post 5 was moderated, I'm posting to trigger email notifications.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  8. #8
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,820
    Hi

    It is very difficult to understand your business process when most of your tables contain Autonumber fields using Text and Number Data Types.
    Also there are no relationships set between any of your tables?

    What is the database designed to do for you?

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

Similar Threads

  1. Replies: 0
    Last Post: 03-18-2016, 09:13 PM
  2. Filter By Form and Apply Filter Buttons
    By JustLearning in forum Forms
    Replies: 13
    Last Post: 02-18-2015, 01:01 PM
  3. Replies: 3
    Last Post: 11-27-2012, 07:20 AM
  4. Replies: 1
    Last Post: 08-16-2012, 01:51 PM
  5. Replies: 28
    Last Post: 03-08-2012, 06:47 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