R
rocketD
Hello,
I have a form that has some unbound controls that pass criteria to a
query that displays in the lower half of the form. One of the fields
I have criteria for is a yes/no field called invalidEmail. The values
are yes if the email is invalid; no if the email is valid. In the
query, I want the user to be able to display (1) only records with
invalid emails or (2) only records with valid emails or (3) all
records. I tried a form checkbox where in the query, the criterion is
forms.fm__.checkbox, but that will only give me displays 1 and 2.
So, I tried 3 option buttons, but because they are numeric, I can't
set a value at * to get select all. So I tried the following
statement:
IIf([forms].[fmQryByClinic].[emailOptions]=1,True,IIf([forms].
[fmQryByClinic].[emailOptions]=2,False,"*"))
Access doesn't like this if [emailOptions]=3, which is my intended
"show all" button, or if no options are selected. The error message
is "The expression is typed incorrectly or too complex to be
evaluated...."
It doesn't seem right, but I also tried:
IIf([forms].[fmQryByClinic].[emailOptions]=1,True,IIf([forms].
[fmQryByClinic].[emailOptions]=2,False,IIf([forms].[fmQryByClinic].
[emailOptions]=3,"*","*"))
Access doesn't like that either, same error.
Does anyone know what I'm missing here?
Thanks,
Dara
I have a form that has some unbound controls that pass criteria to a
query that displays in the lower half of the form. One of the fields
I have criteria for is a yes/no field called invalidEmail. The values
are yes if the email is invalid; no if the email is valid. In the
query, I want the user to be able to display (1) only records with
invalid emails or (2) only records with valid emails or (3) all
records. I tried a form checkbox where in the query, the criterion is
forms.fm__.checkbox, but that will only give me displays 1 and 2.
So, I tried 3 option buttons, but because they are numeric, I can't
set a value at * to get select all. So I tried the following
statement:
IIf([forms].[fmQryByClinic].[emailOptions]=1,True,IIf([forms].
[fmQryByClinic].[emailOptions]=2,False,"*"))
Access doesn't like this if [emailOptions]=3, which is my intended
"show all" button, or if no options are selected. The error message
is "The expression is typed incorrectly or too complex to be
evaluated...."
It doesn't seem right, but I also tried:
IIf([forms].[fmQryByClinic].[emailOptions]=1,True,IIf([forms].
[fmQryByClinic].[emailOptions]=2,False,IIf([forms].[fmQryByClinic].
[emailOptions]=3,"*","*"))
Access doesn't like that either, same error.
Does anyone know what I'm missing here?
Thanks,
Dara