I have a table (TextTbl) containing several text fields, and a table containing a list of keywords (KeywordTbl), ordered by 'priority'. I would like to populate a TextTbl.Keyword field within each record to contain the highest-priority keyword found within its text fields.
I have written the following query:
Unfortunately, this method seems to simply populate the TextTbl.Keyword field with the first Keyword.Keyword that is found when reading through the text fields from left to right.
For example:
KeywordTbl
1 Score
2 Four
3 Seven
TextTbl
"Four score and seven..."
The above query will return 'Four' as TextTbl.Keyword . I would like it to return 'Score', because score is higher on the priority list.
Thank you in advance for your help and please let me know if I can better clarify my situation.
I have written the following query:
Code:
UPDATE KeywordTbl, TextTbl SET TextTbl.Keyword = [KeywordTbl].[Keyword] WHERE (TextTbl.TextField1 & TextTbl.TextField2 & TextTbl.TextField3 Like "*" & [Keyword].[Keyword] & "*")
For example:
KeywordTbl
1 Score
2 Four
3 Seven
TextTbl
"Four score and seven..."
The above query will return 'Four' as TextTbl.Keyword . I would like it to return 'Score', because score is higher on the priority list.
Thank you in advance for your help and please let me know if I can better clarify my situation.
Comment