Flag a keyword vba

marvel

New member
Local time
Today, 09:36
Joined
Apr 20, 2012
Messages
5
I need to set up a query that gives me a list of people if it finds a certain keyword in a certain field.

so if the keyword "kick" appears in the text, I would need it flagged. If the keyword happens to appear I just need the person ID number not the keyword. What would be the logic to pull this off.

vba newbie sorry
 
Will the keywords be the only text in this field? If so you can specify the keywords in the criteria for that field in the query.

If the keywords are just a single word in a string of text then you can use the Instr function to "search" for the word in the field and then return a value based on that.

If you can provide more details about your situation then I can possibly be more specific.
 
It depends what you want to do with the list once you've got it.

The key to it will be the LIKE operator in SQL. E.g.:

SELECT * FROM Table1 WHERE Field1 LIKE '*kick*'

(* is a wildcard in Access SQL)

You could apply a filter to a form with a similar condition. You could build a query in code and open that. You could fill a listbox or combobox with the list. etc.
 
What's your table structure look like, and can you give an example of a record where "kick" would appear?
 

Users who are viewing this thread

Back
Top Bottom