OK ... just a couple of other points:

- yes it is probably better practice, as Sandy suggested, to qualify
the firstname variable with the query name to be on the safe side:
i.e. worksheetfill unless you are sure there are no other 'firstname'
variables around

- crow - i am not sure why owners would be a list if the value is
coming from a form radion button group? this isn't a checkbox result
list?

- Robert - I am assuming that the variable form.owners is coming from
a form radio button? that should mean that this variable will probably
have a single numeric value ? in which case I would name the form
field 'owner' to remove and ambiguity/confusion

- if there is the potential for form.owner to be set up to have more
than one value (seems unlikely  unless you do something like <input
type="radio" name="owners" value="4,5,6">) then you will need to use
something like crow suggested in the SQL where clause:

       WHERE ID in (<cfqueryparam cfsqltype="CF_SQL_INTEGER"
value="#form.owners#" list="Yes">)

- to explain the other bit a little further.... if you need to
actually reference the name of a variable as a paramete in a CF tag
then you need to omit the pound signs and use it's literal value in
the quotes:

e.g. <cfoutput query="worksheetfill">#firstname#</cfoutput>

if you leave the pound signs there, coldfusion will try and resolve
the variable in to its value first - which is why you were getting the
complex variable error (queries are complex variables)

Take this bit of code for example:

<cfset robert = 'worksheetfill'>

<cfdump var="#form#">

<cfset ownerid="#Form.owners#">

<cfquery name="worksheetfill"
       datasource="#Request.DSN#">
       SELECT *
       FROM tblbcplayer
       WHERE ID in (<cfqueryparam cfsqltype="CF_SQL_INTEGER"
value="#form.owners#" list="Yes">)
</cfquery>

 <cfdump var="#worksheetfill#">

<cfoutput query="#robert#">#worksheetfill.firstname#</cfoutput>

here, cf is resolving the value of the variable 'robert' first because
the pound signs are there. Because we have set the variable 'robert'
to a value the same as the query name.... the cfoutput statement
resolves to using the literal name of you query again i.e. the same as
using

<cfoutput query="worksheetfill">#firstname#</cfoutput>

i hope that has made things clearer and not more confusing for you !

it is a bit of a subtle difference when you first start out and will
take a bit of practice to get your head around it and then it will
suddenly become much clearer to you
On 10/6/06, RichL <[EMAIL PROTECTED]> wrote:
> Robert
>
> I think it is because you are using hash/pound signs around the query
> name in the cfoutput
>
> You want to reference the literal name of the query in this piece of
> code so you want to remove the hashes/pound signs:
>
> <cfoutput query="worksheetfill">#firstname#</cfoutput>
>
> try that and see how you get on?
>
> On 10/6/06, Robert Makowski <[EMAIL PROTECTED]> wrote:
> > Ok, so I changed it so it just had #firstname#, and I still received the
> > error.
> >
> > Here is the code from the radio button page:
> >
> > <cfset hoa="#form.Properties#">
> >
> > <cfquery name="owners"
> >        datasource="#Request.MainDSN#">
> >                SELECT *
> >                FROM HOAs INNER JOIN owners ON HOAs.hoaID =
> > owners.project
> >                WHERE HOAS.NAME = <cfqueryparam value="#hoa#" >
> > </cfquery>
> > <!--<cfdump var="#owners#"></cfdump>-->
> >
> >  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
> > <html xmlns="http://www.w3.org/1999/xhtml";>
> > <head>
> > <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"
> > />
> > <title>HOA Owner Infomation</title>
> > </head>
> >
> > <body>
> > <center>
> >        <table border="1">
> >                <tr>
> >                        <td></td>
> >                        <td align="center">Names</td>
> >                        <td align="center">Addresses</td>
> >                </tr>
> >                <cfform name="owner_data" method="post"
> > action="rentalworksheet.cfm">The are the owners at
> > <cfoutput>#hoa#</cfoutput> are:
> >                <cfoutput query="owners">
> >                <tr>
> >                        <td><input type="radio" name="owners"
> > value='#OWNERS.OWNERID#' checked/></td>
> >                        <td>#OWNERS.FIRSTNAME# #OWNERS.LASTNAME#</td>
> >                        <td>#OWNERS.STREET# #OWNERS.CTY#, #OWNERS.STATE#
> > #OWNERS.ZIP#</td>
> >                </tr>
> >
> >                </cfoutput>
> >        </table>
> >        <br />
> >
> >        <input type="submit" />
> >        </cfform>
> >
> > So really all I'm trying to do is enable the user to choose a owner from
> > the list using a radio button selection, then submit it, and I want the
> > table on the worksheet page to fill with the appropriate data.
> >
> > -----Original Message-----
> > From: RichL [mailto:[EMAIL PROTECTED]
> > Sent: Friday, October 06, 2006 10:26 AM
> > To: CF-Newbie
> > Subject: Re: radio buttons
> >
> > Robert
> >
> > Do you need the 'owners.' in prefixed before the 'firstname' variable?
> > I am not too sure why you have got this?
> >
> > If firstname is a column in the 'worksheetfill' query and you have
> > specified that you are outputting that query in the opening <cfoutput>
> > tag then you should be able to reference firstname just as
> > '#firstname#'
> >
> > On 10/6/06, Robert Makowski <[EMAIL PROTECTED]> wrote:
> > > Well I'm trying to populate a table, but when that didn't work I
> > started
> > > debugging.  Here is the code:
> > >
> > > <cfset ownerid="#Form.owners#">
> > >
> > > <cfquery name="worksheetfill"
> > >        datasource="#Request.MainDSN#">
> > >        SELECT *
> > >        FROM OWNERS
> > >        WHERE OWNERID = <cfqueryparam value="#ownerid#">
> > > </cfquery>
> > > <!-- <cfdump var="#worksheetfill#"> -->
> > > <cfoutput query="#worksheetfill#">#owners.firstname#</cfoutput>
> > >
> > > When I try to output the firstname variable, I get this error message:
> > > Complex object types cannot be converted to simple values.
> > >
> > > The expression has requested a variable or an intermediate expression
> > > result as a simple value, however, the result cannot be converted to a
> > > simple value. Simple values are strings, numbers, boolean values, and
> > > date/time values. Queries, arrays, and COM objects are examples of
> > > complex values.
> > >
> > > So at this point I'm stumped.  Any help would be appreciated.  Thanks
> > in
> > > advance.
> > >
> > >
> > >
> > > -----Original Message-----
> > > From: Mike Chytracek [mailto:[EMAIL PROTECTED]
> > > Sent: Friday, October 06, 2006 10:02 AM
> > > To: CF-Newbie
> > > Subject: RE: radio buttons
> > >
> > > The fun thing with radios is you have to check to see if they are
> > > defined.
> > > If you do not require a radio group to be selected it will not come
> > thru
> > > defined.
> > >
> > > What kind of problems are you having?
> > >
> > > Mike
> > >
> > > -----Original Message-----
> > > From: Robert Makowski [mailto:[EMAIL PROTECTED]
> > > Sent: Friday, October 06, 2006 8:45 AM
> > > To: CF-Newbie
> > > Subject: radio buttons
> > >
> > > I am trying to populate a table from a dynamically generated list
> > using
> > > radio buttons.  I am running into problems with this, can someone
> > > explain how this is done or give an example?
> > >
> > >
> > >
> > > Robert Makowski
> > >
> > > IT Manager
> > >
> > > Patriot Residential Management
> > >
> > > phone: 904.483.5160 x5165
> > >
> > > [EMAIL PROTECTED]
> > >
> > >
> > >
> > > ! vv!11 pwnz0r |_|
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> >
> >
> >
> > 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Newbie/message.cfm/messageid:2115
Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15

Reply via email to