Results 1 to 2 of 2
  1. #1
    vector39 is offline Advanced Beginner
    Windows 8 Access 2010 32bit
    Join Date
    May 2017
    Posts
    76

    Search filtered by different columns in listbox

    Hi everyone

    So I have a working search bar that filters data from a listbox based on what the user types in. The list box has 5 columns, 2 are text, 2 are date/time and 1 is yes/no data types. The search bar filters based the first column (company name) and the criteria is as follows in the query:

    Like "*" & [forms]![frmMain]![SrchTxt] & "*"



    I'm just wondering how do I filter columns based on different data types (each column)? I know I need to add more but for the second free text column, I copied the same criteria in the first but nothing came up in the search bar. if anyone knows how to do this any sort of guidance is MUCH appreciated!

    Also, do I need to create more queries? Or can I use the same query just have a different criteria under each field?

  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,652
    I'd use dynamic SQL, but in a query you can use this for the numeric and date fields:

    http://access.mvps.org/access/queries/qry0001.htm
    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. Replies: 2
    Last Post: 12-13-2014, 08:52 PM
  2. Combobox Filtered Search
    By dgwynn in forum Access
    Replies: 3
    Last Post: 12-12-2012, 03:10 PM
  3. Export Filtered ListBox output to a Excel Sheet
    By gokul1242 in forum Programming
    Replies: 4
    Last Post: 10-11-2012, 02:19 PM
  4. Open Report filtered by Date in ListBox
    By TinaCa in forum Programming
    Replies: 1
    Last Post: 03-06-2012, 02:29 PM
  5. Sub form filtered by listbox
    By BorisGomel in forum Forms
    Replies: 3
    Last Post: 05-04-2011, 09:20 AM

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