[AccessD] [SPAM SUSPECT] My Iif expression isn't right

Tina Norris Fields tinanfields at torchlake.com
Tue Aug 15 11:33:11 CDT 2006


Thanks for all the good advice, everyone.  It is working well, now.  I 
really appreciate how hitting the SEND button turns on the brain!
Tina

Bobby Heid wrote:
> Try something like:
> IEP-Sort:Iif([IEP-10]="Yes", 10, Iif([IEP-11] = "Yes",11,12))
>
> I never use "yes" or "no" in a query.  I use True and False.  So if the
> above does not work, try changing it to:
> IEP-Sort:Iif([IEP-10]=true, 10, Iif([IEP-11] = true, 11,12))
>
> Bobby
>
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Tina Norris
> Fields
> Sent: Tuesday, August 15, 2006 11:53 AM
> To: Access Developers discussion and problem solving
> Subject: [SPAM SUSPECT] [AccessD] My Iif expression isn't right
> Importance: Low
>
>
> 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