I have a form (FRMsurveyRepor ts) with several combo boxes (e.g. Class, ClassUnique, SurveyID, etc.) which use an SQL query based on a table (TBLSurveyRespo nses) for their record source. The available options filter based on any criteria selected in the combo boxes above them. If nothing is selected, all options should be visible.
For example, consider the following combo boxes below.
ClassUnique
SurveyID
Using code #1 below, if I leave the ClassUnique selection blank, SurveyID will only return records where the ClassUnique value is not null (because the wildcard character doesn't find null values). However, I can't seem to find a good variation on the code to include the nulls. Code #2 below is my latest attempt, but simply returns an error saying, “This expression is typed incorrectly, or is too complex to be evaluated.”
Code #1
Code #2
Any ideas? Thanks for your help!
For example, consider the following combo boxes below.
ClassUnique
SurveyID
Using code #1 below, if I leave the ClassUnique selection blank, SurveyID will only return records where the ClassUnique value is not null (because the wildcard character doesn't find null values). However, I can't seem to find a good variation on the code to include the nulls. Code #2 below is my latest attempt, but simply returns an error saying, “This expression is typed incorrectly, or is too complex to be evaluated.”
Code #1
Code:
Like nz([Forms]![FRMsurveyReports].[ClassUnique],"*")
Code:
IIf([Forms]![FRMsurveyReports].[ClassUnique] Is Null,([TBLSurveyResponses].[ClassUnique]) Like "*" Or ([TBLSurveyResponses].[ClassUnique]) Is Null,([TBLSurveyResponses].[ClassUnique]) Like [Forms]![FRMsurveyReports].[ClassUnique])
Comment