Switch Expression Too complex

purceld2

Registered User.
Local time
Today, 17:01
Joined
Dec 4, 2008
Messages
79
I have a question to ask you concerning the switch command below I have listed the syntax which I have in a field in a query which works fine

Expr1: Switch([PROGRAM_CODE]="PM000F2C","BT.com Project",[PROGRAM_CODE]="PM000AMU","Broadband Project",[PROGRAM_CODE]="PM000AND","CORE Project",[PROGRAM_CODE]="PM000F2C","BT.com Project",[PROGRAM_CODE]="PM000AMW","CRM Project",[PROGRAM_CODE]="PM000AMY","Customer Ex Project",[PROGRAM_CODE]="PM000AN0","Devices Project",[PROGRAM_CODE]="PM000AN2","Mobility Project",[PROGRAM_CODE]="PM000AN4","Other Project",[PROGRAM_CODE]="PM000CML","Right First Time - L2C",[PROGRAM_CODE]="PM000CMN","Right First Time - T2R",[PROGRAM_CODE]="PM000CMO","Right First Time - bt.com",[PROGRAM_CODE]="PM000AN6","Sales Project",[PROGRAM_CODE]="PM000AN8","VAS Project")

But if try to add the last two elements

,[PROGRAM_CODE]="PM000ANA","Vision Project",[PROGRAM_CODE]="PM000VNC","Voice & VOIP Project"

and try and run the query I get a error saying the expression too complex. it seem quite simple to me. I have tried to use the IIF command instead but cannot seem to get the syntax correct.

Have you got any advise?
 
With that many options, I think you'd be better off creating a table with those associations. Then you can just link to it in the query, or use a DLookup on a form, or whatever. It would be a lot easier to keep updated when the options change.
 
Thanks Pbaldy for the advise did create a new table which worked fine

once again thank you.

regards

Desmond
 

Users who are viewing this thread

Back
Top Bottom