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.
Thank you for your answer!
Would you please give me an example?
Regards
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.
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
see allen browne search sample
I submitted sample to forum that may be helpful at
https://www.accessforums.net/sample-...rch-49804.html
I made a YouTube video on this a while back:
https://www.youtube.com/watch?v=N0X8Hg-Sm6A
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.
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
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?
Chris2810,
I don't think the version has anything to with the issue.
Can you post a zip copy of your database?
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!
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]
chris,
Steve has multiple videos (all great!) on Access programming--starting at
https://www.youtube.com/watch?v=kogGwRIHH6o
Just saw your latest post.
You can look at this link
http://allenbrowne.com/ser-62.html
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?