I have a query that uses criteria from a form. I want to filter a numeric column named [STAGE] by what the users pick from a combo box on a form. The combo box is named [cboFilStage] and its values are "1,2,3,All stages". If the user selects "All stages" then all records are returned.
In my query, I have this expression:
The above expression works fine for all selections except for "All stages". If the user selects "All stages", the expression then returns an error that my expression is too complex.
Can anyone help with this query? Below is the sql query string:
In my query, I have this expression:
Code:
[[I][B]STAGE[/B][/I]]=[forms]![frmSummaryList]![[I][B]cboFilStage[/B][/I]] Or IIf([forms]![frmSummaryList]![cboFilStage]="All stages",[forms]![frmSummaryList]![cboFilStage] Is Null)
The above expression works fine for all selections except for "All stages". If the user selects "All stages", the expression then returns an error that my expression is too complex.
Can anyone help with this query? Below is the sql query string:
Code:
SELECT TrainingView.FirstName, TrainingView.UserId AS txtEmail, TrainingView.Location, TrainingView.Stage
FROM TrainingView
WHERE (((TrainingView.UserId) Is Not Null) AND (([stage]=[forms]![frmSummaryList]![cboFilStage] Or IIf([forms]![frmSummaryList]![cboFilStage]="All stages",[forms]![frmSummaryList]![cboFilStage] Is Null))=True));