J
Jen
In a qyery I retrieve a value from a form. The values comes from 5 Option
Buttons in a optionframe, values of the optionbuttons being 1, 2, 3, 4 and
5. If the value of the optionframe is 1, 2, 3 or 4 thats what the query
should stick with (and does too). But if the value is 5, then the query
should retrieve the values 1 and 2.
If I write "1 or 2" in the query criteria then I get these two. If I however
try to put them in an iif() statement in the criteria of the query like:
IIf([Forms]![startform]![subform_lista_per_tid_status].[Form]![frame_status]
=5;1 Or
2;[Forms]![startform]![subform_lista_per_tid_status].[Form]![frame_status])
then it doesn't work.
In summary, what I want to do is to have the query behave the same way as
when I write "1 or 2" (without "-marks) in the query's Criteria grid. This
only when the forms (from where I launch the query) optionbuttons frame's
value is 5. Otherwise the query should give whatever the optionframe's value
is (i.e 1, 2, 3, 4). Any ideas, or am I doing this wrong altogether?
Also tried different approaches with code within Vba, but without success.
Jen.
Buttons in a optionframe, values of the optionbuttons being 1, 2, 3, 4 and
5. If the value of the optionframe is 1, 2, 3 or 4 thats what the query
should stick with (and does too). But if the value is 5, then the query
should retrieve the values 1 and 2.
If I write "1 or 2" in the query criteria then I get these two. If I however
try to put them in an iif() statement in the criteria of the query like:
IIf([Forms]![startform]![subform_lista_per_tid_status].[Form]![frame_status]
=5;1 Or
2;[Forms]![startform]![subform_lista_per_tid_status].[Form]![frame_status])
then it doesn't work.
In summary, what I want to do is to have the query behave the same way as
when I write "1 or 2" (without "-marks) in the query's Criteria grid. This
only when the forms (from where I launch the query) optionbuttons frame's
value is 5. Otherwise the query should give whatever the optionframe's value
is (i.e 1, 2, 3, 4). Any ideas, or am I doing this wrong altogether?
Also tried different approaches with code within Vba, but without success.
Jen.