Andrew - 

In CF when passing in paramaters to a tag they come in through the 'attributes' scope 
- so 
you're eventual tag should look something like:
(Also added cfqueryparam as well to your query)

<cfparam name="attributes.SelectedOfficeID" type="numeric">

<cfoutput>
        <cfquery name="getOfficeLocs" datasource="mydata">
                SELECT YOfficeID AS SelectedOfficeID, OfficeName
                FROM         YesOffices
                WHERE         Active = 1
                ORDER BY OfficeName 
        </cfquery>
        <cfquery name="getSelectedOffice" datasource="mydata">
                SELECT YOfficeID AS SelectedOfficeID, OfficeName
                FROM YesOffices
                WHERE Active = 1
                        and Yofficeid= <cfqueryparam 
value="#attributes.SelectedOfficeID#" 
cfsqltype="CF_SQL_NUMERIC"> 
        </cfquery>
</cfoutput>

To get the details out - you will probably need to look into the 'caller' scope as 
well - which is 
essentially the 'variables' scope of the page that called the module.

Hope that helps you out.

Mark
------------------------------------------------------------------
[EMAIL PROTECTED]
ICQ: 3094740
Safe From Bees
[ www.safefrombees.com ]


Quoting Andrew Dickinson <[EMAIL PROTECTED]>:

> My first tag is not going according to plan.
> 
> I'm attempting to reuse this code :
> 
> <cfoutput>
>       <cfquery name="getOfficeLocs" datasource="mydata">
>               SELECT YOfficeID AS SelectedOfficeID, OfficeName
>               FROM    YesOffices
>               WHERE   Active = 1
>               ORDER BY OfficeName 
>       </cfquery>
>       <cfquery name="getSelectedOffice" datasource="mydata">
>               SELECT YOfficeID AS SelectedOfficeID, OfficeName
>               FROM YesOffices
>               WHERE Active = 1
>                       and Yofficeid=#SelectedOfficeID#
>       </cfquery>
> </cfoutput>
> 
> ... which sets up for a dropdown menu.
> 
> I've saved this code as SelectOffices.cfm, and called it as
> <cf_selectoffices> - this is as
> the CFMX reference manual suggests.
> 
> The problem seems to be the parameter. When I modify the call to
> <cf_selectoffices SelectedOfficeID="#SelectedOfficeID#">
> it falls over, pointing to an error on this line
> "and Yofficeid=#SelectedOfficeID#"
> 
> So I went back to the book and followed the starter example, wihch simply
> creates a file called date.cfm containing today's date, then calls <cf_date>
> from a
> different program. This works. However, when I try to pass a parameter,
> any parameter, using any of the methods in the book, it doesn't work (i.e
> throws an error).
> 
> What am I missing here ?

---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

Reply via email to