Iif within Iif not working

G

Guest

I have a simple database with one table and one form. The table stores a
project name and the the values from each of 5 Option Groups. Each Option
Group has 4 options The options are given values 1 through 4. The form has
the 5 questions, one for each of the Option Groups. There is also a field
for the results of the combined questions.

If a user selects the first option for each question then the sum of those
selected options would be 5. If the last option was selected for each
question, then the sum of those options would be 20. I have an Iif statement
to decide what to do if the sum is within a certain range.

=IIf((([VolumeOption]+[ComplexityOption]+[SensitivityOption]+[BreadthOption]+[TimeOption])>=5
&
([VolumeOption]+[ComplexityOption]+[SensitivityOption]+[BreadthOption]+[TimeOption])<=8),"8.0%","Exceeded range")

No matter what options are selected, the result is always "8.0%". I've
checked the table Option values are being changed but the Iif result is
always "8.0%".

Any ideas?

Thanks in advance for your help!
 
T

tina

try replacing the ampersand (&) with the word And, and make sure there is a
space on either side of the And.

or, try simplifying your expression to

=IIf(([VolumeOption]+[ComplexityOption]+[SensitivityOption]+[BreadthOption]+
[TimeOption]) Between 5 And 8, "8.0%", "Exceeded range")

hth


dgreen said:
I have a simple database with one table and one form. The table stores a
project name and the the values from each of 5 Option Groups. Each Option
Group has 4 options The options are given values 1 through 4. The form has
the 5 questions, one for each of the Option Groups. There is also a field
for the results of the combined questions.

If a user selects the first option for each question then the sum of those
selected options would be 5. If the last option was selected for each
question, then the sum of those options would be 20. I have an Iif statement
to decide what to do if the sum is within a certain range.

=IIf((([VolumeOption]+[ComplexityOption]+[SensitivityOption]+[BreadthOption]
+[TimeOption])>=5
&
([VolumeOption]+[ComplexityOption]+[SensitivityOption]+[BreadthOption]+[Time
Option])<=8),"8.0%","Exceeded range")
 
G

Guest

Thank you so much! Tried both ways and both worked! Didn't know Between
could be used that way. Like the simplier method. Thanks again!!!!!!!!!

tina said:
try replacing the ampersand (&) with the word And, and make sure there is a
space on either side of the And.

or, try simplifying your expression to

=IIf(([VolumeOption]+[ComplexityOption]+[SensitivityOption]+[BreadthOption]+
[TimeOption]) Between 5 And 8, "8.0%", "Exceeded range")

hth


dgreen said:
I have a simple database with one table and one form. The table stores a
project name and the the values from each of 5 Option Groups. Each Option
Group has 4 options The options are given values 1 through 4. The form has
the 5 questions, one for each of the Option Groups. There is also a field
for the results of the combined questions.

If a user selects the first option for each question then the sum of those
selected options would be 5. If the last option was selected for each
question, then the sum of those options would be 20. I have an Iif statement
to decide what to do if the sum is within a certain range.

=IIf((([VolumeOption]+[ComplexityOption]+[SensitivityOption]+[BreadthOption]
+[TimeOption])>=5
&
([VolumeOption]+[ComplexityOption]+[SensitivityOption]+[BreadthOption]+[Time
Option])<=8),"8.0%","Exceeded range")
No matter what options are selected, the result is always "8.0%". I've
checked the table Option values are being changed but the Iif result is
always "8.0%".

Any ideas?

Thanks in advance for your help!
 
T

tina

you're very welcome! :)


dgreen said:
Thank you so much! Tried both ways and both worked! Didn't know Between
could be used that way. Like the simplier method. Thanks again!!!!!!!!!

tina said:
try replacing the ampersand (&) with the word And, and make sure there is a
space on either side of the And.

or, try simplifying your expression to

=IIf(([VolumeOption]+[ComplexityOption]+[SensitivityOption]+[BreadthOption]+
[TimeOption]) Between 5 And 8, "8.0%", "Exceeded range")

hth


dgreen said:
I have a simple database with one table and one form. The table stores a
project name and the the values from each of 5 Option Groups. Each Option
Group has 4 options The options are given values 1 through 4. The
form
has
the 5 questions, one for each of the Option Groups. There is also a field
for the results of the combined questions.

If a user selects the first option for each question then the sum of those
selected options would be 5. If the last option was selected for each
question, then the sum of those options would be 20. I have an Iif statement
to decide what to do if the sum is within a certain range.
=IIf((([VolumeOption]+[ComplexityOption]+[SensitivityOption]+[BreadthOption]
+[TimeOption])>=5
([VolumeOption]+[ComplexityOption]+[SensitivityOption]+[BreadthOption]+[Time
Option])<=8),"8.0%","Exceeded range")
No matter what options are selected, the result is always "8.0%". I've
checked the table Option values are being changed but the Iif result is
always "8.0%".

Any ideas?

Thanks in advance for your help!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top