F
Flora M
Hi All,
I have created a framed option group called fra_cost in my form called
frm_search_criteria. In the option group there are three toggle
buttons labelled <, > and =. In the Option Group Wizard I assigned the
value of 3 to <, 2 to > and 1 to =.
Now I want to take the returned value from fra_cost and apply it to an
nested iif statement. I've tried numerous statements including:
Like
IIf([forms]![frm_Search_Criteria]![fra_cost]="<",<[forms]![frm_search_criteria]![txt_cost],
IIf([forms]![frm_Search_Criteria]![fra_cost]=">",>[forms]![frm_search_criteria]![txt_cost],
IIf([forms]![frm_Search_Criteria]![fra_cost]="=",=[forms]![frm_search_criteria]![txt_cost],"*")))
The above statement returns all the rows in my table (it should return
two rows).
Like
IIf([forms]![frm_Search_Criteria]![fra_cost]="3",<[forms]![frm_search_criteria]![txt_cost],
IIf([forms]![frm_Search_Criteria]![fra_cost]="2",>[forms]![frm_search_criteria]![txt_cost],
IIf([forms]![frm_Search_Criteria]![fra_cost]="1",=[forms]![frm_search_criteria]![txt_cost],"*")))
The above statement doesn't return any rows.
Like
IIf([forms]![frm_Search_Criteria]![fra_cost]=3,<[forms]![frm_search_criteria]![txt_cost],
IIf([forms]![frm_Search_Criteria]![fra_cost]=2,>[forms]![frm_search_criteria]![txt_cost],
IIf([forms]![frm_Search_Criteria]![fra_cost]=1,=[forms]![frm_search_criteria]![txt_cost],"*")))
The above statement doesn't return any rows.
Maybe I've got the nested iif statement all wrong. Obviously, I don't
understand what kind of value is returned from my framed option group
("<", ">", "=" or "3", "2", "1" or 3, 2, 1)???
I would like to take the returned value from fra_cost and apply it as a
logical operand in a statement that would read something like: If
fra_cost is found to be "less than", then find the records where the
value in the cost column is "less than" the value for txt_cost (a
number also entered in the frm_Search_Criteria form).
To make a long story short, is my problem in the way I've nested the
iif statements or because I referred to the fra_cost value incorrectly
in the statement? I'd welcome any other thoughts that may come to
mind.
Thanks so much!!
I have created a framed option group called fra_cost in my form called
frm_search_criteria. In the option group there are three toggle
buttons labelled <, > and =. In the Option Group Wizard I assigned the
value of 3 to <, 2 to > and 1 to =.
Now I want to take the returned value from fra_cost and apply it to an
nested iif statement. I've tried numerous statements including:
Like
IIf([forms]![frm_Search_Criteria]![fra_cost]="<",<[forms]![frm_search_criteria]![txt_cost],
IIf([forms]![frm_Search_Criteria]![fra_cost]=">",>[forms]![frm_search_criteria]![txt_cost],
IIf([forms]![frm_Search_Criteria]![fra_cost]="=",=[forms]![frm_search_criteria]![txt_cost],"*")))
The above statement returns all the rows in my table (it should return
two rows).
Like
IIf([forms]![frm_Search_Criteria]![fra_cost]="3",<[forms]![frm_search_criteria]![txt_cost],
IIf([forms]![frm_Search_Criteria]![fra_cost]="2",>[forms]![frm_search_criteria]![txt_cost],
IIf([forms]![frm_Search_Criteria]![fra_cost]="1",=[forms]![frm_search_criteria]![txt_cost],"*")))
The above statement doesn't return any rows.
Like
IIf([forms]![frm_Search_Criteria]![fra_cost]=3,<[forms]![frm_search_criteria]![txt_cost],
IIf([forms]![frm_Search_Criteria]![fra_cost]=2,>[forms]![frm_search_criteria]![txt_cost],
IIf([forms]![frm_Search_Criteria]![fra_cost]=1,=[forms]![frm_search_criteria]![txt_cost],"*")))
The above statement doesn't return any rows.
Maybe I've got the nested iif statement all wrong. Obviously, I don't
understand what kind of value is returned from my framed option group
("<", ">", "=" or "3", "2", "1" or 3, 2, 1)???
I would like to take the returned value from fra_cost and apply it as a
logical operand in a statement that would read something like: If
fra_cost is found to be "less than", then find the records where the
value in the cost column is "less than" the value for txt_cost (a
number also entered in the frm_Search_Criteria form).
To make a long story short, is my problem in the way I've nested the
iif statements or because I referred to the fra_cost value incorrectly
in the statement? I'd welcome any other thoughts that may come to
mind.
Thanks so much!!