Results 1 to 2 of 2
  1. #1
    JimR is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Dec 2012
    Posts
    3

    LIKE function in queries - adding wildcards to user entry

    I want a large group to be able to search within a query of names and experiences, to find all the names that have a common experience.

    I can get the desired result by using the LIKE function in the criteria for experience (e.g., LIKE [Search Criteria]. The user then opens the query (or related form) and is first asked to enter the Search Criteria. For example, to find everyone who owns a Chevrolet, they can enter *Chev* or *Chevrolet*. (The database entry could be "Owns a Chevrolet" but the user may not know the exact wording, so the wild cards bring up the right answers.)

    What I am trying to do is make this more user friendly, by allowing the user to enter the search criteria without the wildcard characters, and have the query reinterpret the user's entry to search for any appropriate response. In other words, to take a user entry of "Chev" and make it become "*Chev*".

    I've tried adding a "Searchcriteria1" column in the query, which would be the user's input, and a "Searchcriteria2" column which would be ="*"&[Searchcriteria1]&"*". This puts the search in the right format, but I can't use Searchcriteria2 as the criteria for the query -- Access won't let me -- so this is probably not the correct approach.



    How can I set up the query so that a user can select a specific search criteria and then have the query add the wild card characters so that the response includes all of the relevant records?

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,725
    You may get some info from the posts and databases in this thread
    https://www.accessforums.net/queries...09/index2.html

    Good luck with your project.

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

Similar Threads

  1. duplicate entry flag to user
    By markjkubicki in forum Programming
    Replies: 3
    Last Post: 06-14-2012, 11:13 AM
  2. WILDCARDS in Queries
    By jasonbarnes in forum Queries
    Replies: 1
    Last Post: 09-26-2011, 02:20 PM
  3. Can you use wildcards in parameter queries?
    By noaccessguru in forum Queries
    Replies: 5
    Last Post: 05-24-2011, 08:44 PM
  4. If Statements with user entry too
    By jheintz57 in forum Programming
    Replies: 1
    Last Post: 09-15-2010, 02:37 PM
  5. Adding colorfield to entry
    By carstenhdk in forum Forms
    Replies: 10
    Last Post: 05-10-2010, 05:36 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