The problem is due to a text field named "Description" which allows for non-standardized entries. (I have NO control over this)
This field "Description" is the basis for the record being placed in a category.
Most of the time "Description" will contain some variation of the words listed below but the list will likely grow.
I am using the following in a query to find words within "Description". I then use the DSearch result to look up the appropriate Category in a separate table.
DSearch: IIf([Description] Like "*Record*","Record",Null) & IIf([Description] Like "*Security*","Security",Null) & IIf([Description] Like "*Deposit*","Deposit",Null) & IIf([Description] Like "*Shred*","Shred",Null) & IIf([Description] Like "*Monumental*" Or [Description] Like "*Surcharge*","Surcharge",Null) & IIf([Description] Like "*Research*","Research",Null)
While this does work it has become apparent that the list of words being searched for will continue to grow. As a result, DSearch will need to be edited and may become too long and more important, other users will not be able modify the DSearch Code.
I have tried placing the words to search for in a table;
SELECT tblSearch.DSearch, MainList.Description
FROM MainList, tblSearch
WHERE (((MainList.Description) Like "*" & [tblSearch].[DSearch] & "*"));
In this query tblSearch contains the list of words to search for.
But this narrows the results of the query which I do not want to do, I just want DSearch to show what word was found in “Description”.
If I leave off the WHERE Clause then the query returns a number of rows that far exceeds the actual number of rows in the MainList Table.
I am open to any ideas or suggestions for an alternative method for:
DSearch: IIf([Description] Like "*Record*","Record",Null) & IIf([Description] Like "*Security*","Security",Null) & IIf([Description] Like "*Deposit*","Deposit",Null) & IIf([Description] Like "*Shred*","Shred",Null) & IIf([Description] Like "*Monumental*" Or [Description] Like "*Surcharge*","Surcharge",Null) & IIf([Description] Like "*Research*","Research",Null)
Thank you
Accel45
This field "Description" is the basis for the record being placed in a category.
Most of the time "Description" will contain some variation of the words listed below but the list will likely grow.
I am using the following in a query to find words within "Description". I then use the DSearch result to look up the appropriate Category in a separate table.
DSearch: IIf([Description] Like "*Record*","Record",Null) & IIf([Description] Like "*Security*","Security",Null) & IIf([Description] Like "*Deposit*","Deposit",Null) & IIf([Description] Like "*Shred*","Shred",Null) & IIf([Description] Like "*Monumental*" Or [Description] Like "*Surcharge*","Surcharge",Null) & IIf([Description] Like "*Research*","Research",Null)
While this does work it has become apparent that the list of words being searched for will continue to grow. As a result, DSearch will need to be edited and may become too long and more important, other users will not be able modify the DSearch Code.
I have tried placing the words to search for in a table;
SELECT tblSearch.DSearch, MainList.Description
FROM MainList, tblSearch
WHERE (((MainList.Description) Like "*" & [tblSearch].[DSearch] & "*"));
In this query tblSearch contains the list of words to search for.
But this narrows the results of the query which I do not want to do, I just want DSearch to show what word was found in “Description”.
If I leave off the WHERE Clause then the query returns a number of rows that far exceeds the actual number of rows in the MainList Table.
I am open to any ideas or suggestions for an alternative method for:
DSearch: IIf([Description] Like "*Record*","Record",Null) & IIf([Description] Like "*Security*","Security",Null) & IIf([Description] Like "*Deposit*","Deposit",Null) & IIf([Description] Like "*Shred*","Shred",Null) & IIf([Description] Like "*Monumental*" Or [Description] Like "*Surcharge*","Surcharge",Null) & IIf([Description] Like "*Research*","Research",Null)
Thank you
Accel45