query criteria - building "In" clause in "hidden" textbox - mult values
I have a report that has an Access query as its record source. I have a form for the user to enter criteria for the query. I have combo boxes that hold query criteria and they all work fine.
I have a list box control with which users can select multiple items. Behind the scenes I am building an "in" clause in a hidden textbox. Then, I thought I could just use this text box in the query as criteria on a certain column.
[Forms]![FileQualityReports]![txtHiddenCriteriaLineOfBusiness]
I know the value in the text box is
In ('AUTO','HOME')
which should return some rows when used as query criteria. I'm afraid the query is evaluating my "in" clause as if it is a literal string. So, I went into query parameters and set the datatype of that parameter to be value, not text. (Actually, I've tried both.) No luck.
I've also tried to have the text box just contain 'AUTO','HOME' and build the rest of the in clause in the criteria grid of the query. Same result.
Can anyone help explain why this isn't working. I've been struggling with it quite a while and I'm really stumped. Any advice appreciated!
I have a report that has an Access query as its record source. I have a form for the user to enter criteria for the query. I have combo boxes that hold query criteria and they all work fine.
I have a list box control with which users can select multiple items. Behind the scenes I am building an "in" clause in a hidden textbox. Then, I thought I could just use this text box in the query as criteria on a certain column.
[Forms]![FileQualityReports]![txtHiddenCriteriaLineOfBusiness]
I know the value in the text box is
In ('AUTO','HOME')
which should return some rows when used as query criteria. I'm afraid the query is evaluating my "in" clause as if it is a literal string. So, I went into query parameters and set the datatype of that parameter to be value, not text. (Actually, I've tried both.) No luck.
I've also tried to have the text box just contain 'AUTO','HOME' and build the rest of the in clause in the criteria grid of the query. Same result.
Can anyone help explain why this isn't working. I've been struggling with it quite a while and I'm really stumped. Any advice appreciated!