J
jhawk
I'm creating an application that can create a multi-parameter query
on-the-fly using VBA and an Access form. As part of the query creation
process, the user is asked to identify a number of keywords that he would
like to use as search criteria. I've accomplished this using multi-select
list boxes and then concatenating the resulting selections into a single
string to be used in the final SQL statement.
However, due to the nature of the data being searched, there is the
possibility to have certain words repeated. What I want to do is: first,
extract from the final SQL WHERE statement all of the words that begin with
'* and end with *' and put them into an array or table; second, select only
distinct words from this quasi-recordset; third, identify which of these
keywords are actually found when the query is run; and finally, use these
remaining keywords as search criteria for querying a different dataset.
I have no idea how to do this. I'm a little familiar with the InStr, and
Left/Right/Mid functions, but don't if this is a good approach.
If anyone has any idea how to do this, or could suggest an alternate way,
please let me know; I would appreciate it.
on-the-fly using VBA and an Access form. As part of the query creation
process, the user is asked to identify a number of keywords that he would
like to use as search criteria. I've accomplished this using multi-select
list boxes and then concatenating the resulting selections into a single
string to be used in the final SQL statement.
However, due to the nature of the data being searched, there is the
possibility to have certain words repeated. What I want to do is: first,
extract from the final SQL WHERE statement all of the words that begin with
'* and end with *' and put them into an array or table; second, select only
distinct words from this quasi-recordset; third, identify which of these
keywords are actually found when the query is run; and finally, use these
remaining keywords as search criteria for querying a different dataset.
I have no idea how to do this. I'm a little familiar with the InStr, and
Left/Right/Mid functions, but don't if this is a good approach.
If anyone has any idea how to do this, or could suggest an alternate way,
please let me know; I would appreciate it.