IIF Expressions

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

Guest

Hi,

I've written an expression that says when Tracking Database = Yes, RAG
Status = Red (text). I need to extend this expression so that when Tracking
Database = No, RAG Status = Green and when Tracking Database = Maybe, RAG
Status = Amber

Can anyone help

The expression so far is....

=IIf([Tracking Database]="Yes","Red")
 
=IIf([Tracking Database]="Yes","Red", IIf([Tracking
Database]="No","Green",IIf([Tracking Database]="Maybe","Amber","????")))

However, you might consider building a table that maps from Tracking
Database value to RAG Status, and join that table to your other table.
 
Thanks for your help, however when I do this the field results in #Name?
--
Mike Mc1981


Douglas J Steele said:
=IIf([Tracking Database]="Yes","Red", IIf([Tracking
Database]="No","Green",IIf([Tracking Database]="Maybe","Amber","????")))

However, you might consider building a table that maps from Tracking
Database value to RAG Status, and join that table to your other table.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Mike Mc1981 said:
Hi,

I've written an expression that says when Tracking Database = Yes, RAG
Status = Red (text). I need to extend this expression so that when Tracking
Database = No, RAG Status = Green and when Tracking Database = Maybe, RAG
Status = Amber

Can anyone help

The expression so far is....

=IIf([Tracking Database]="Yes","Red")
 
Hi Mike

If you have typed Douglas' answer is it is shown then you would get ?Name
normally if either the control source contains a formula and part of this is
no longer available and or (more likely) you have mis-spelt part of the
formula.

An old trick is to try and remove the table identifier from the formula
so if you have =[Forms]![WaynesStuff]![FieldName]
then try and use
=[FieldName]

Note if you are in a query you should NOT remove the identifier if the field
has not been brought into the query - you may have only inserted the table
into the design section at the top of the screen

If you are not sure about field names and what can and can not be used you
should try the Expression Builder as it will only include available items and
will not make spelling miostakes. (with an "o")


Hope this helps

--
Wayne
Manchester, England.



Mike Mc1981 said:
Thanks for your help, however when I do this the field results in #Name?
--
Mike Mc1981


Douglas J Steele said:
=IIf([Tracking Database]="Yes","Red", IIf([Tracking
Database]="No","Green",IIf([Tracking Database]="Maybe","Amber","????")))

However, you might consider building a table that maps from Tracking
Database value to RAG Status, and join that table to your other table.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Mike Mc1981 said:
Hi,

I've written an expression that says when Tracking Database = Yes, RAG
Status = Red (text). I need to extend this expression so that when Tracking
Database = No, RAG Status = Green and when Tracking Database = Maybe, RAG
Status = Amber

Can anyone help

The expression so far is....

=IIf([Tracking Database]="Yes","Red")
 
Back
Top