Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 16th, 2006, 04:47 PM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 106
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Corey
Default Multiple IIF statements

I'm trying to compile a number of IIF statements.

I have 6 IIF statements, but would like to put them all in to one IIF statement.

Could anyone help me with this one?

OrderTrack: IIf([O_SRC_CD]="2005WMDT","Web","Phone")
OrderTrack: IIf([O_SRC_CD]="2005WMKE","Internet","Phone")
OrderTrack: IIf([O_SRC_CD]="DOGNET23","Web","Fax")
OrderTrack: IIf([O_SRC_CD]="CANTRY3J","Web","")
OrderTrack: IIf([O_SRC_CD]="MAMTWOSE","Web",",")
OrderTrack: IIf([O_SRC_CD]="2005W999","Web","Mail")

Thank you for your help and time

Corey


 
Old November 16th, 2006, 05:25 PM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Hi Corey,

This can get really ugly, but you could do it like this...

OrderTrack: IIf([O_SRC_CD]="2005WMDT","Web",IIf([O_SRC_CD]="2005WMKE","Internet",IIf([O_SRC_CD]="DOGNET23","Web", IIf([O_SRC_CD]="CANTRY3J","Web","")))) etc. etc.

The tricky part is getting the number of parenthesis figured out right!!

The other option could be to create a function that will take care of this, then just have something like OrderTrack: OrderTrack([O_SRC_CD])

Good luck,

Mike



Mike
EchoVue.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
IIF multiple criteria stealthdevil Access VBA 10 November 28th, 2007 11:37 AM
IIf Function - Multiple conditions carrie09 Access 2 June 13th, 2007 10:27 AM
Mulitiple/Nested IIF statements rohit_ghosh Access VBA 3 June 1st, 2007 10:44 AM
Multiple IIF Statements rohit_ghosh Access 2 May 7th, 2007 03:05 PM
Logic builiding with Nested/Multiple IIF rohit_ghosh Access 4 May 4th, 2007 09:52 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.