Results 1 to 5 of 5
  1. #1
    jaaferalakkal is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Oct 2016
    Posts
    2

    query not filtering keywords

    Click image for larger version. 
<br /><script async src=
    Name: Access - consolidatioon_Backup_Backup Database- CUsersaccountsDesktopACCESSconsolidatioon_Backu.jpg  Views: 17  Size: 42.7 KB  ID: 26288" class="thumbnail" style="float:CONFIG" />


    I have query to display vendor numbers and vendor names as shown in the picture, when I leave the parameter prompt colum and I enter the next parameter prompt "Thailand" it displays all vendors. Please help

  2. #2
    warmslime is offline Advanced Beginner
    Windows 10 Access 2013
    Join Date
    Jan 2016
    Posts
    49
    I don't get it, why are you repeating the same field twice in the query? What is [enter keyword] and why do you have two parameters for the same field? Also I don't get what the "or" line means at all? Try expressing your criteria and your parameter(s) in plain words first.

  3. #3
    Micron is offline Very Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    Quote Originally Posted by warmslime View Post
    I don't get it, why are you repeating the same field twice in the query?
    Where do you see that? One field is named No_ and the other is Name (name is a reserved word and should not be a field or object name).
    What is [enter keyword]
    This makes it a parameter query - user will get a prompt.
    and why do you have two parameters for the same field? Also I don't get what the "or" line means at all?
    The second line is asking for all records where vendor is Null. However, the or is declared at the left side of the grid - you do not add it to the criteria.
    Second, you don't use Like with Null or Is Null. Like is a comparison operator and there is nothing to compare if the field is Null. Like is for criteria with wild cards.
    Last edited by Micron; 10-30-2016 at 12:51 PM. Reason: clarification
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  4. #4
    jaaferalakkal is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Oct 2016
    Posts
    2
    Thank you for your reply. for further clarification, for eg: i have 4 vendors named 1) abcvendor 2) cdevendor 3) fgevendor 4) abcdvendor . when i click run button a prompt will ask [enter vendor no ] , if i leave blank another prompt will pop up to [enter keyword] then i will enter "abc" so it will display only a vendor with letter abc , the result must be vendor no 1 and 4, but in this scenario i am getting a result that showing all the 4 vendors which i have. Anyone please suggest appropriate query.

  5. #5
    Micron is offline Very Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    Try pasting this into a new query
    Code:
    SELECT [No_], [Name] FROM [dbo_Wear Mart Warehouse$Vendor] WHERE 
    [dbo_Wear Mart Warehouse$Vendor].[No_] = [ENTER VENDOR NO] AND 
    [dbo_Wear Mart Warehouse$Vendor].[Name] Like "'*" & [enter keyword] & "*'";
    Note the single quotes within the double quotes. This assumes the first prompt expects a number and the second is text.

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

Similar Threads

  1. Lookup Column Using Specific Keywords Only
    By maeyks in forum Access
    Replies: 2
    Last Post: 03-24-2016, 07:29 PM
  2. Assigning keywords to long text fields.
    By mdv1978 in forum Access
    Replies: 1
    Last Post: 08-02-2012, 08:04 AM
  3. Looking for Keywords in a Field
    By wetsparks in forum Queries
    Replies: 4
    Last Post: 07-02-2012, 10:56 AM
  4. how to highlight search keywords in results form?
    By Absolute_Beginner in forum Forms
    Replies: 2
    Last Post: 08-22-2011, 04:52 AM
  5. How to Search for keywords in a Query
    By Brian62 in forum Queries
    Replies: 2
    Last Post: 05-24-2010, 11:14 AM

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