That's neat Gustav. I'd have used IIF but I know that that's hard on
resources. Is SWITCH any better?<BR><BR>--<BR>Andy
Lacey<BR>http://www.minstersystems.co.uk<BR><BR><BR><BR>
<BLOCKQUOTE dir=ltr style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px;
MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">--------- Original Message --------<BR>From:
"Access Developers discussion and problem solving"
<accessd@databaseadvisors.com><BR>To: "AccessD@databaseadvisors.com"
<AccessD@databaseadvisors.com><BR>Subject: [AccessD] A use for
Switch()<BR>Date: 10/10/03 13:34<BR><BR><FONT face="Courier New"
size=2><BR>Hi all<BR><BR>I've never found a use for Switch() but the other
day a client asked<BR>me to sort a small combobox in a weird way without
adding a new column<BR>with a sort index.<BR><BR>Here you can use
Switch().<BR>An example is how to sort colours by
description:<BR><BR><SQL><BR><BR>SELECT<BR>ID,<BR>Description<BR>FROM<BR>tblColours<BR>ORDER
BY<BR>Switch(<BR>[Description]="Red",1,<BR>[Description]="Yellow",2,<BR>[Description]="Green",3,<BR>[Description]="Cyan",4,<BR>[Description]="Blue",5,<BR>[Description]="Magenta",6,<BR>True,9);<BR><BR></SQL><BR><BR>Note
the last item for "catch any not
listed".<BR><BR>/gustav<BR><BR>_______________________________________________<BR>AccessD
mailing list<BR><A class=autolink
href="mailto:AccessD@databaseadvisors.com">AccessD@databaseadvisors.com</A><BR><A
class=autolink href="http://databaseadvisors.com/mailman/listinfo/accessd"
target=_blank>http://databaseadvisors.com/mailman/listinfo/accessd</A><BR>Website:
<A class=autolink href="http://www.databaseadvisors.com/"
target=_blank>http://www.databaseadvisors.com</A><BR><BR><BR><BR><BR></FONT></DIV></BLOCKQUOTE><BR
/>
<BR />
________________________________________________<BR />
Message sent using UebiMiau 2.7.2<BR />