Results 1 to 6 of 6

Query Search with Wildcards

  1. #1
    mick2000 is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2019
    Posts
    3

    Unhappy Query Search with Wildcards

    Hi all,

    Pretty been working with access for a few years, just for small companies etc I work with. This current employer needs a database of items which are specific to vehicles.

    This has been pretty well built and happy with it so far. However I am trying to set up a search query to bring up all versions and years of the requested model. Obvously I have prompt to enter the Model required,
    however i need the results to expand to all entries with MOndeo in that field. Some have years, some have MK classifcations. I have been trying all the compinations of prompts and wild cards but to no avail.

    In criteria area for the Model field I have =[Enter Model Required], which obviously looks for the model, lets say, MONDEO. However the variations in that field within the data are like:

    Mondeo MK4
    Mondeo MK4 (Bootmat - 8495)
    Mondeo MK4 (Bootmat Set - 8495)
    Mondeo (Bootmat - 8491)
    Mondeo (Bootmat - 8496)
    Mondeo (Bootmat - 8497)
    Mondeo
    Mondeo Hatchback (Bootmat - 8810)
    Mondeo Hatchback (Bootmat Set - 8810)

    So how can I allow user to add Mondeo, to the query and bring all entries for display.

    Now driving me nuts.

    Anyone have an idea how to achieve this please?

    Thanks in advance.


    Mick

  2. #2
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,830
    Try this in your Criteria section:
    Code:
    Like "*" & [Enter Model Required] & "*"
    Using Access 2007
    Proficient in Access, Excel, VBA, and SQL

  3. #3
    mick2000 is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2019
    Posts
    3
    Thank you so much. I have been trying this for days and I notice a space lol.
    Really appreciate the quick turn around.
    Thank you.

  4. #4
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,830
    You are weclome.
    Using Access 2007
    Proficient in Access, Excel, VBA, and SQL

  5. #5
    mick2000 is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2019
    Posts
    3
    Thanks again for the assist, I have another similar question. I would like to allow a search query which allows the input of some detail and pull all info that contains it. Basically we have order numbers that are made up by a number, an abbreviation of the sales channel, then the first 4 of the date. Examples would be:

    01 AM 0111
    02 EB 0111

    Our scanning system collects this information along a production process so date time and operator for each function of the process. This would effectively mean that each order will have 4 or five entries per order number so data will look like:

    01 AM 0111 CUT MICK 01/11/19 0900
    01 AM 0111 SEW SHARON 01/11/19 0927
    01 AM 0111 CLIP BRENDA 01/11/19 1144
    01 AM 0111 DISPATCH DAVID 02/11/19 0830

    We can already search for a particular order by obviously query 01 AM 0111, however I would like to add functionality that allows the user to search for all "AM 0111" entries and show in a split form. I have tried every combination that I can think of to achieve this and failed miserably.

    Can any one advise please?

    thanks in advance
    Mick

  6. #6
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    14,287
    You could add again to the criteria that JoeM provided.

    Code:
    where 
    somefield Like "*" & [Enter Model Required] & "*" and 
    somefield like "*" &[Enter additional search info] & "*"

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

Similar Threads

  1. OpenForm with multiple search criteria and wildcards
    By guitarzycki in forum Programming
    Replies: 6
    Last Post: 01-18-2018, 08:45 AM
  2. Replies: 3
    Last Post: 09-21-2016, 06:35 AM
  3. Search in a Form with Wildcards
    By excellenthelp in forum Programming
    Replies: 6
    Last Post: 06-19-2014, 03:05 PM
  4. Replies: 2
    Last Post: 08-09-2013, 09:21 AM
  5. Replies: 2
    Last Post: 06-14-2013, 12:56 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
  •  
Tech Forums: Microsoft Office Forums