G
Guest
I have a form with five simple multiselect listboxes from which I want to run
a query and ultimately print a report. I have a hidden textbox for each of
the listboxes to which I refer to in the query criteria for the approriate
field. The reference works fine if only one value is selected from the
listbox, but I get an error if more than one value is selected. I have used
VBA to get the textbox to report each of the following, but I have the same
problem if more than one value is selected:
Attempt #1:
txtlinear: (when more than one value selected from the list box)
30 , 40
query criteria: In( [Forms]![GrowerSearchF]![txtlinear])
Attempt #2:
30 Or 40
query criteria: [Forms]![GrowerSearchF]![txtlinear]
Attempt #3:
Select * from Linear where [Linear]=30 OR [Linear]=40
query criteria: [Forms]![GrowerSearchF]![txtlinear]
Error message:
This expression is typed incorrectly, or it is too complex to be evaluated.
For example, a numeric expression may contain too many complicated elements.
Try simplifying the expression by assigning parts of the expression to
variables. (Error 3071)
Again, the reference works fine when the text box reports only one value
selected, ie:
30
30
Select * from Linear where [Linear]=30
Please help before I beat my head against the computer screen.
Thanks, Jess
a query and ultimately print a report. I have a hidden textbox for each of
the listboxes to which I refer to in the query criteria for the approriate
field. The reference works fine if only one value is selected from the
listbox, but I get an error if more than one value is selected. I have used
VBA to get the textbox to report each of the following, but I have the same
problem if more than one value is selected:
Attempt #1:
txtlinear: (when more than one value selected from the list box)
30 , 40
query criteria: In( [Forms]![GrowerSearchF]![txtlinear])
Attempt #2:
30 Or 40
query criteria: [Forms]![GrowerSearchF]![txtlinear]
Attempt #3:
Select * from Linear where [Linear]=30 OR [Linear]=40
query criteria: [Forms]![GrowerSearchF]![txtlinear]
Error message:
This expression is typed incorrectly, or it is too complex to be evaluated.
For example, a numeric expression may contain too many complicated elements.
Try simplifying the expression by assigning parts of the expression to
variables. (Error 3071)
Again, the reference works fine when the text box reports only one value
selected, ie:
30
30
Select * from Linear where [Linear]=30
Please help before I beat my head against the computer screen.
Thanks, Jess