I am using an unbound form to feed parameters to a query. On the left I have a list box with the Multi-select property set to extended. I feed the selected items into a textbox on the right which has some code behind it to format the string. The textbox will eventually be hidden. In the query I have as a parameter [forms]![formname]![textboxname] (not their real names, obviously).
When I input a single record, the query runs fine. When I put in more than one, I end up with an error message saying the parameters are too complicated. The string created in the textbox is just a list of numbers separated by Or exactly as I would type into the criteria of the query by hand, e.g. 1 Or 3 Or 6
I am missing something (perhaps quotes?) when I create my string. I know it shouldn’t be a difficult problem, but I’m not sure where I am dropping the ball. I am working with numbers, but since these are generated from a couple of earlier levels of query to filter out my end list, I’m not sure whether that may be some of my problem. I did try setting the format in the parameter query to General Number but that didn’t make a difference. I can post the code if you want to see it. It is taken from Access Developer’s Handbook, chapter 7 – Multiselect. The breakdown is clearly in feeding multiple numbers to the query.