Multiple un-nested IIF statements in a report text box

hardin4019

Registered User.
Local time
Today, 16:21
Joined
Apr 28, 2010
Messages
15
Hi Guys,
Bare with me, I'm still new to Access and have limited VB knowlege. And for what it is worth, I am using MS Access 97.

Issue:
I have a text box in a report for an attendance DB I have made that I want to look at a sum box right next to it, and return one of two strings of text based on the value of the sum. The report works great, listing the people, each instance of an attendance issue, the point value assigned to each instance (hidden to the end user), and in the detail footer a sum of all the points they have incurred by missing days, being tardy, leaving early etc. What I am trying to do with this text box is string together 3 IIF statements listed below:

=IIf([Sum Of PointValue]=(2),"Warning","")
=IIf([Sum Of PointValue]=(2.5),"Warning","")
=IIf([Sum Of PointValue]>=(3),"Terminate","")

Less than 2 points, no message, greater than 3 as you can see, "Terminate".

As it stands now, I have 3 separate text boxes, all identically sized and placed ontop of each other, no one would ever know the difference. So, somewhere is someone who may be able to teach me to put in a single If for the [Sum Of PointValue] between 2 and 2.5 instead of 2 separate statements and yet another great piece of advice, how to line all 3 of these (or the two condensed) into a single line and a single text box?
 
PS... I just tried this, it returns a -1 after the details for each employee, regardless of if they should have a warning/terminate or nothing.

=(IIf([Sum Of PointValue]=(2),"Warning","") Or IIf([Sum Of PointValue]=(2.5),"Warning","") Or IIf([Sum Of PointValue]>=(3),"Terminate",""))
 
Try this:
Code:
=IIf([Sum Of PointValue] BETWEEN 2 AND 2.5,"Warning", IIf([Sum Of PointValue]>=3,"Terminate",""))
 
Try this:
Code:
=IIf([Sum Of PointValue] BETWEEN 2 AND 2.5,"Warning", IIf([Sum Of PointValue]>=3,"Terminate",""))

Works like a champ stopher! And from the looks of it, I wrongly assumed that it would/should be an un-nested IIF statement. I swear I thought I had used the Between command once before and it didn't work, but most likely it didn't because of how the rest of the statement was setup. Thank you! :D
 

Users who are viewing this thread

Back
Top Bottom