A
anna_717717
Hi all, hope someone can help me
I need to filter a query depending on the values on a form.
If a check box is ticked I want to return all the records. If not I want to
filter it by several selection choices. I've tried the code below but this
returns an error 'The expression is typed incorrectly, or it is too complex
to be evaluated'
IIf([Forms]![SelectionForm]![checkAll]=-1,"*",([Task].[TaskID])=[Forms]![SelectionForm]![Selection1]
Or ([Task].[TaskID])=[Forms]![SelectionForm]![Selection2] Or
([Task].[TaskID])=[Forms]![SelectionForm]![Selection3] Or
([Task].[TaskID])=[Forms]![SelectionForm]![Selection4] Or
([Task].[TaskID])=[Forms]![SelectionForm]![Selection5] Or
([Task].[TaskID])=[Forms]![SelectionForm]![Selection6] Or
([Task].[TaskID])=[Forms]![SelectionForm]![Selection7] Or
([Task].[TaskID])=[Forms]![SelectionForm]![Selection8] Or
([Task].[TaskID])=[Forms]![SelectionForm]![Selection9])
Any help much appreciated
I need to filter a query depending on the values on a form.
If a check box is ticked I want to return all the records. If not I want to
filter it by several selection choices. I've tried the code below but this
returns an error 'The expression is typed incorrectly, or it is too complex
to be evaluated'
IIf([Forms]![SelectionForm]![checkAll]=-1,"*",([Task].[TaskID])=[Forms]![SelectionForm]![Selection1]
Or ([Task].[TaskID])=[Forms]![SelectionForm]![Selection2] Or
([Task].[TaskID])=[Forms]![SelectionForm]![Selection3] Or
([Task].[TaskID])=[Forms]![SelectionForm]![Selection4] Or
([Task].[TaskID])=[Forms]![SelectionForm]![Selection5] Or
([Task].[TaskID])=[Forms]![SelectionForm]![Selection6] Or
([Task].[TaskID])=[Forms]![SelectionForm]![Selection7] Or
([Task].[TaskID])=[Forms]![SelectionForm]![Selection8] Or
([Task].[TaskID])=[Forms]![SelectionForm]![Selection9])
Any help much appreciated