Im assuming it's coming from the switch itself

<cfswitch expression="#Games.GameMasterID#">

Games.GameMasterID is a query result, correct? You can't set the switch
expression directly to a query result, as there may be one or many results.
You can set a separate variable based on the result then use it as the
switch expression:

<cfset variables.mySwitchVal = Games.GameMasterID>
<cfswitch expression="#variables.mySwitchVal#">


=]

On Sat, May 29, 2010 at 9:09 AM, Phillip Vector
<[email protected]>wrote:

>
> I have the following code... Why am I getting a "This expression must
> have a constant value." error? I looked online, but I didn't find
> anyplace that explained it clearly.
>
>                                                        <cfinclude
> template="qry_CheckRSVP.cfm">
>                                                        <cfswitch
> expression="#Games.GameMasterID#">
>                                                                <cfcase
> value="#session.UserID#">
>
>  GMing
>                                                                </cfcase>
>                                                                <cfcase
> value="999">
>                                                                        No
> GM Yet
>                                                                </cfcase>
>
>  <cfdefaultcase>
>
>  <cfoutput>
>
>    <cfif CheckRSVP.Recordcount EQ 0>
>
>            <form method="post" action="#myself#Schedule.Signup">
>
>                    <input type="Submit" class="submit" Name="Submit"
> value="RSVP">
>
>            </form>
>
>    <cfelse>
>
>            <form method="post" action="#myself#Schedule.Delete">
>
>                    <input type="Submit" class="submit" Name="Submit"
> value="Remove RSVP">
>
>            </form>
>
>    </cfif>
>
>  </cfoutput>
>
>  </cfdefaultcase>
>                                                        </cfswitch>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:334115
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to