Nested IIf statements

davea300

Registered User.
Local time
Today, 08:18
Joined
Mar 16, 2007
Messages
164
Hi

I have a report that shows a field which gets dats from a picklist used in a form. The picklist has 19 values, each one has description text and a number (2 separate fields). The number HAS to be stored in the table, no way around that for me.

When I display the field in a report the it (correctly) shows the number that has been selected and not the description text. I want to display the text in the report instead so I started using IIf statments in the report field:

= IIf([14a]=4,"Own property secured through employment/tied",
IIf([14a]=5,"Own property owning/buying",
IIf([14a]=6,"Parental/family home/relatives",
IIf([14a]=7,"Friends/Partners",
IIf([14a]=8,"Armed Services Acommodation",
IIf([14a]=9,"Prison",IIf([14a]=10 etc etc

It works fine but I get an error message when I add in more IIf terms, "expression is too complex". I have 18 IIf statements that I need to add.

Any way around this?
 
If the report is based on a query (which it should be) then simply link to the table storing the description and use the query to selectthe appropriate description.

No IIF statements required

L
 

Users who are viewing this thread

Back
Top Bottom