Search any part of a field using an Access Query

Posted on 2009-04-21
Last Modified: 2013-11-27
Hi All,
I know this question has probably been asked before but I am creating a query that searchs a table from a form for specific data. However the search at present is word specific. What i am looking for is can the query be modified so as if I put greene in the title part of the search it will search through any part of the Title field and return the result.
I have attached my sql code of the query as it stands. There are 7 search fields that I would like to make this change to

FROM [AGO Inventory]

WHERE (Barcode Like [forms]![Search Form]![Barcode] & "*" 

OR [forms]![Search Form]![Barcode] Is Null


AND ([Customer Number] Like [forms]![Search Form]![Customer Number] & "*" 

OR [forms]![Search Form]![Customer Number] Is Null


AND (Title Like [forms]![Search Form]![Title] & "*" 

OR [forms]![Search Form]![Title] Is Null


AND ([Media Type] Like [forms]![Search Form]![Media Typer] & "*" 

OR [forms]![Search Form]![Media Type] Is Null


AND ([S C] Like [forms]![Search Form]![S C] & "*" 

OR [forms]![Search Form]![S Cr] Is Null


AND (Keyword Like [forms]![Search Form]![Keyword] & "*" 

OR [forms]![Search Form]![Keyword] Is Null


AND ([Free Text] Like [forms]![Search Form]![Free Text] & "*" 

OR [forms]![Search Form]![Free Text] Is Null


Open in new window

Question by:AGOIT
    LVL 65

    Expert Comment

    You are using wildcards already but looking for something that starts with your text
    If you put * in front as well then it would look for anything that starts with, ends or in between
    LVL 65

    Accepted Solution


    WHERE (Barcode Like   "*" & [forms]![Search Form]![Barcode] & "*"

    Author Closing Comment

    Legend. Thanks so much. Cant believe it was that simple and I over looked it. Works perfectly now

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
    Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
    Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
    Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

    731 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now