Results 1 to 3 of 3
  1. #1
    Dachbo is offline Advanced Beginner
    Windows 7 32bit Access 2013
    Join Date
    May 2015
    Posts
    42

    Filter data by criteria using text box

    I would like to filter my data with a text box. I want to find entries which have some numbers in common. So I want to type in something (let's say three numbers) in the text box and I want to find all records which have these three numbers in a specific column in common.



    I have this code but I don't know how to use something like a wild card to filter and show the results in a list box

    Code:
    Dim int_WC As Integer
    
    Me.txt_WC = int_WC
    
    Me.lstbx_WC.RowSource = "SELECT WBS_element, Work_Ctr FROM Table1 WHERE " & Work_Ctr = "*int_WC" & ""
    The column I want to filter is Work_Ctr

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    if you FILTER data, this means your form already shows a continuous form (or single) of data
    also, wildcards use LIKE not equal sign...
    when you click the filter button,

    Code:
    me.filter = "[Work_Ctr] like '*" & int_WC  & "*'"
    me.filter0n = true

  3. #3
    Dachbo is offline Advanced Beginner
    Windows 7 32bit Access 2013
    Join Date
    May 2015
    Posts
    42
    how can I display the results in a listbox or subform?
    and the filter is not working on the table, do I have to set it as the current database?

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

Similar Threads

  1. Replies: 9
    Last Post: 02-24-2015, 11:19 AM
  2. Replies: 6
    Last Post: 09-23-2013, 03:17 PM
  3. Filter data by number as text column.
    By msadiqrajani in forum Access
    Replies: 14
    Last Post: 08-15-2012, 02:34 PM
  4. Query: How To Filter Data In Criteria
    By netchie in forum Queries
    Replies: 1
    Last Post: 08-31-2011, 01:36 PM
  5. Filter non-text data
    By bdriscoll in forum Access
    Replies: 2
    Last Post: 09-25-2009, 05:49 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