Search by Keyword

MG101

Registered User.
Local time
Today, 14:42
Joined
May 22, 2013
Messages
63
Hi All,

I currently have a database with a few search forms. I recently attempted to add a box on one of my search forms to search 3 cells of a record for a key word. What happens is when I go to search, say for P0442, it does not bring up all of the records that contain that keyword in the 3 cells I have outlined. If I step down the code in the OR boxes of the query, it seems to work better but then for some reason my other search criteria , (Tracking number etc) does not work. I will upload the database for reference. I am currently working on the Search(View Only) and that is where you will find the query to work on. All help is much appreciated!


On the Search(ViewOnly) form I have 5 search criteria. Trracking Number, Date Code, VIN, Part Number, and Keyword or Phrase. Before adding the Keyword phrase to the search query everything works fine. I want the Keyword box to search in 3 cells of each record: Remarks, Additional Remarks, and Test Details. For Example: If I want to serach all records for "P0442" I could type that in the Keyword Search Box and it would find all records containing "P0442" in those three cells (Remarks, Additional Remarks, and Test Detail)

Thanks!


Thanks!

MG101
 

Attachments

You do need to use OR, stepped down as you say. If you have other criteria these need to be repeated on each line.

The alternative is to create an algorithm for all three fields e.g. on the field line put

Code:
instr([Field1] & "|" & [Field2] & "|" & [Field3],searchStr)
and in the criteria row put
Code:
<>0

I've included pipes (|) so you don't get a 'bleed' between fields
 
Hi,

I tried both of your suggestions but they didnt seem to work. :(

Would you mind looking at my file and trying it for yourself?

Thanks!
 

Attachments

When you say don't seem to work, please can you be more specific - code fails (in which case error code and message), results not as expected or what?

If you phoned your mechanic and said, 'my car's not working' what would you expect him to do?
 
Both of your suggestions are not solutions to my problem.

I plugged the code in and recieved an error.
I also tried stacking them per your instructions and the keyword search does not function.

Can you look at my provided database and try to fix the issue?
 
I answered to the best of my ability. I am not an expert in Access and I thought you would help me by looking at the databse, as everyone who has helped me on here has. But Im going to assume you dont know much about it either. Thanks for your help.
 

Users who are viewing this thread

Back
Top Bottom