[AccessD] My Iif expression isn't right

Gustav Brock Gustav at cactus.dk
Tue Aug 15 11:03:18 CDT 2006


Hi Tina

If checkboxes, why not just sort on the values:

  ORDER BY
    ABS([IEP-10]) DESC,
    ABS([IEP-11]) DESC,
    ABS([IEP-12]) DESC

/gustav


>>> tinanfields at torchlake.com 15-08-2006 17:53:16 >>>
Hi all,

Well, you helped me yesterday with my tab control background color issue. 

I've got another one to solve pronto.

My client wanted three yes/no checkboxes for each student, labeled 
IEP-10, IEP-11, and IEP-12 - these were to indicate whether an IEP 
evaluation had been carried out for the student and in which grade, 10, 
11, or 12.  At the time, I was assured this was never going to be used 
for sorting.  Riiiiight!  So, there are three separate fields in the 
student table. 

Now, we need to create a report showing all students for whom the IEP 
has been carried out, and - you guessed it -  sort first on the IEP 
grade (10, 11, or 12), and then alphabetically by student name.

I decided to add a computed field to my query that looks for a "Yes" in 
any of the three fields, and to give a value to that field based on 
which IEP field was "Yes" like so:
IEP-Sort:Iif([IEP-10]="Yes", 10, Iif([IEP-11] = "Yes", 11, 
Iif([IEP-12]="Yes", 12, "")))

The idea then, is to sort on the computed field.  The query finds the 
records and fills in all the fields correctly except for my IEP-Sort 
field - there it gives me the #Error.  Okay, I don't know what my error 
is.  Please, how do I figure out my goof and fix it?  I will be watching 
for a reply and trying to think it out at the same time.  Any help 
appreciated.

Thanks,
Tina





More information about the AccessD mailing list