Conditional Statement

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In my report I have an unbound text box [Text25] that shows a percentage
based on the values in two other text boxes (ex: =[Text22]/[Text23]). In a
fourth box [Text4], I have the following conditional statement:
=IIf([Text25]>=".9500","Pass","Fail")

This statement works the first time, but if the values change in [Text25] to
below 95%, the value in [Text4] still returns "Pass" unless I fiddle with the
statement and then try it again.

Am I wrong to assume that if the value in [Text25] drops below 95%, [Text4]
should read "Fail" which is the desired outcome?

What have I done wrong? How do I fix this statement to produce the desired
outcome every time?

Thanks in advance for your assistance.
 
Use this in [Text4] ----
=IIf([Text22]/[Text23] >=.9500,"Pass","Fail")

Use no quotes around the numerical value .9500 as that makes it text.
 
In my report I have an unbound text box [Text25] that shows a percentage
based on the values in two other text boxes (ex: =[Text22]/[Text23]). In a
fourth box [Text4], I have the following conditional statement:
=IIf([Text25]>=".9500","Pass","Fail")

This statement works the first time, but if the values change in [Text25] to
below 95%, the value in [Text4] still returns "Pass" unless I fiddle with the
statement and then try it again.

Am I wrong to assume that if the value in [Text25] drops below 95%, [Text4]
should read "Fail" which is the desired outcome?

What have I done wrong? How do I fix this statement to produce the desired
outcome every time?

Thanks in advance for your assistance.

If I read your statement correctly, Text25 is a Number value.
YetText4 asks if Text25 >=".9500"
Placing the .9500 within quotes makes the value a string.

Try it this way:

=IIf([Text25]>=.9500,"Pass","Fail")

or perhaps this way, by repeating the original calculation (which is
the way I would do it if you don't need to show the actual number
amount).
=IIf([Text22]/[Text23] >= .9500,"Pass","Fail")
 
Thank you Karl and Fred! Your help is appreciated.
--
Michael


fredg said:
In my report I have an unbound text box [Text25] that shows a percentage
based on the values in two other text boxes (ex: =[Text22]/[Text23]). In a
fourth box [Text4], I have the following conditional statement:
=IIf([Text25]>=".9500","Pass","Fail")

This statement works the first time, but if the values change in [Text25] to
below 95%, the value in [Text4] still returns "Pass" unless I fiddle with the
statement and then try it again.

Am I wrong to assume that if the value in [Text25] drops below 95%, [Text4]
should read "Fail" which is the desired outcome?

What have I done wrong? How do I fix this statement to produce the desired
outcome every time?

Thanks in advance for your assistance.

If I read your statement correctly, Text25 is a Number value.
YetText4 asks if Text25 >=".9500"
Placing the .9500 within quotes makes the value a string.

Try it this way:

=IIf([Text25]>=.9500,"Pass","Fail")

or perhaps this way, by repeating the original calculation (which is
the way I would do it if you don't need to show the actual number
amount).
=IIf([Text22]/[Text23] >= .9500,"Pass","Fail")
 
Back
Top