ease20022002
Board Regular
- Joined
- Jun 4, 2005
- Messages
- 233
Hi,
I have a SELECT query. I also have a custom VBA function that is put in the WHERE Clause. I.e.,
Now, the Line field is a string DType. If MyFunction = "HELLO", the query will only retrieve records WHERE Line = "HELLO". Here is the problem, because I am using an IN statement, I want to reference more values under the field Line than just "HELLO", but when I make MyFunction = "HELLO, HI", my query doesn't recognize any value and 0 records are returned.
I have tried several variations of the IN statement, i.e., putting single quotes around " 'HELLO', 'HI' ", etc. I have also tried in the WHERE clause, Line LIKE, Line =, and MyFunction only works with one value.
What I want to do is have the query recognize a longer text string with commas, which currently it is not doing. I only want to use the VBA function and the Select query. I do not want to set up another table and do a Join, or anything like that. There must be a way to force the query to recognize something like " 'HELLO', 'HI' ".
Thanks in advance for any help.
I have a SELECT query. I also have a custom VBA function that is put in the WHERE Clause. I.e.,
Code:
WHERE Line IN (MyFunction());
Now, the Line field is a string DType. If MyFunction = "HELLO", the query will only retrieve records WHERE Line = "HELLO". Here is the problem, because I am using an IN statement, I want to reference more values under the field Line than just "HELLO", but when I make MyFunction = "HELLO, HI", my query doesn't recognize any value and 0 records are returned.
I have tried several variations of the IN statement, i.e., putting single quotes around " 'HELLO', 'HI' ", etc. I have also tried in the WHERE clause, Line LIKE, Line =, and MyFunction only works with one value.
What I want to do is have the query recognize a longer text string with commas, which currently it is not doing. I only want to use the VBA function and the Select query. I do not want to set up another table and do a Join, or anything like that. There must be a way to force the query to recognize something like " 'HELLO', 'HI' ".
Thanks in advance for any help.