Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    Akbari is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Dec 2015
    Posts
    2

    How To Create A Keyword Search in Access 2013?

    I have created a keyword search engine but since I have some dropdowns in some fields, the sub form is showing the ID of the record instead of the value. For more information please see the print screen:



    Click image for larger version. 

Name:	Search Option.JPG 
Views:	42 
Size:	42.9 KB 
ID:	23031

    Thank you for your cooperation

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    The form RecordSource must be a query that includes the lookup tables so that all related information is available. Bind textboxes to fields of the lookup tables.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Akbari is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Dec 2015
    Posts
    2
    Thank you for your answer!

    Would you please give me an example?

    Regards

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    What do you not understand about the instructions? Build a query that includes related tables. Set the form RecordSource to this query. Bind textboxes to fields from the lookup tables. Don't allow edits of these fields, set the textboxes Locked property to Yes.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    Also, you may not have used a separate table when you built your lookup field. In case you used a Value List for your Lookup Field, you will need to use the IN operator in the Criteria of your query. In other words, you would add the name of the Field that is the Lookup Field to your query's design grid and then add Criteria using the IN operator. The criteria would include the values you wish humans to see.
    https://www.youtube.com/watch?v=HW7FepuOY-g

  6. #6
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870

  7. #7
    Xipooo's Avatar
    Xipooo is offline Sr. Database Developer
    Windows 8 Access 2013
    Join Date
    Jan 2014
    Location
    Arizona
    Posts
    332
    I made a YouTube video on this a while back:
    https://www.youtube.com/watch?v=N0X8Hg-Sm6A

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    Also, post the code behind the Search button.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  9. #9
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Excellent video xipooo.

    Regarding the video, the OP (Akbari) should be aware that the use of the LIKE operator with * (wildcard characters) before and after the txtKeywords will allow the user to Enter a string. The search will look for that string anywhere in the [Last Name] or [First Name].

    eg. Instead of typing Elizabeth, the user could have entered liza or abet or eth or any character or set of characters. All records containing the search string would be returned.
    Last edited by orange; 12-13-2015 at 04:12 PM. Reason: spelling

  10. #10
    Chris2810 is offline Novice
    Windows 8 Access 2016
    Join Date
    Feb 2016
    Location
    Missouri, United States
    Posts
    9
    Xipooo I watched your video on YouTube and it was amazing. I am trying to create a keyword search on a form and I followed your instructions step by step. Yet, when I click the button, it does not work.

    Could it be that I am using Access 2010 instead of 2013?

  11. #11
    orange's Avatar
    orange is online now Moderator
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Chris2810,

    I don't think the version has anything to with the issue.
    Can you post a zip copy of your database?

  12. #12
    Chris2810 is offline Novice
    Windows 8 Access 2016
    Join Date
    Feb 2016
    Location
    Missouri, United States
    Posts
    9
    Never mind. . I figured out the problem:

    In the code, there was an extra space in the quotations for the where clause. So my search was looking for the first part of the field to have a space. Once I deleted that, it works like a charm!

    Good to know. Thanks again for the great video! I am learning so much!

  13. #13
    Chris2810 is offline Novice
    Windows 8 Access 2016
    Join Date
    Feb 2016
    Location
    Missouri, United States
    Posts
    9
    Instead of using Xipooo's technique that involves using a subform, what is the best way to do a keyword search on just a form?

    I have a split form, but the user only sees the header that has a title and a couple buttons. Below the header, all they see is the datasheet view.

    I want to add a keyword search at the top in the header section that will filter the data in the datasheet view.

    Should the search button have code like this:

    me.recordsource = [Insert Query here]

  14. #14
    orange's Avatar
    orange is online now Moderator
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870

  15. #15
    Chris2810 is offline Novice
    Windows 8 Access 2016
    Join Date
    Feb 2016
    Location
    Missouri, United States
    Posts
    9
    Thank you Orange! I will check them out. I am just now learning VBA.

    Basically I am just trying to find some instructions on how to use code to set the recordsource of a form or filter a form.

    Does using form.filter and form.recordsource essentially accomplish the same thing?

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. keyword search
    By Mbakker71 in forum Access
    Replies: 5
    Last Post: 02-05-2014, 06:03 AM
  2. keyword search in a combo box
    By pbouk in forum Forms
    Replies: 9
    Last Post: 05-30-2013, 09:45 PM
  3. A TRUE Keyword Search
    By Meep in forum Queries
    Replies: 72
    Last Post: 05-13-2013, 06:45 PM
  4. Multiple Keyword Search
    By gatsby in forum Access
    Replies: 15
    Last Post: 01-21-2013, 10:53 PM
  5. Keyword search with Access 2010 FE
    By Brian62 in forum SQL Server
    Replies: 1
    Last Post: 06-15-2012, 06:06 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