Iif statement syntax help

twitchie

Registered User.
Local time
Today, 11:33
Joined
Jan 16, 2003
Messages
41
Hello. I have an Iif statement where based on the number in the [Score] text box, a certain phrase is displayed in the [Ranking] text box. For instance, if the score in greater than 0 And less than 49, then a phrase such as "Try again" is displayed. If the score is greater than or equal to 50 AND less than 75 then a phrase such as "Better job" appears and so on. Below is the string I am using that just creates an empty area. I don't know if I newed a regular Iif statement or if I need to have a loop of some sort. Any help would be greatly appreciated! Thanks.

Iif statement I have that is NOT working:

Iif [Score] > 0 And <= 49, "Try again", ""
Iif [Score] >= 50 And <= 74, "Better job", ""
Iif [Score] > 74, "Awesome!", ""
End Iif
 
You seem to be mixing IIf() and If/Then syntax. Try this if you really want IIf().

IIf(Score < 50, "Try Again", IIf(Score < 75, "Better", "Awesome"))
 

Users who are viewing this thread

Back
Top Bottom