Thanks for everyone's help. 

Here is how I finally accomplished it. I used a variant of Sean's example:

<CFLOOP INDEX="field_name" LIST="#form.fieldnames#">
                <cfoutput>#evaluate('form.' & field_name)#</CFOUTPUT>
</CFLOOP>

I gave every check box a name (Q1,Q2,Q3...) -I'm only up to 21 right now.

And created this code in the results page (I omitted the table formatting to
make it easier to read):


<CFLOOP INDEX="Field" LIST="#Form.FieldNames#">
<CFSET Val = Evaluate("Form.#Field#")>

<cfquery name="#field#" datasource="survey" dbtype="ODBC">
SELECT DISTINCT FIRST_NAME, LAST_NAME, CAMPUS_ADDRESS_1, OFFICE_PHONE,
EMAIL, SCHOOL, QUESTION_NAME, TOPIC_NAME
FROM FACULTY, ANSWER, QUESTION, TOPIC
WHERE
QUESTION$QUESTION_ID = QUESTION_ID
AND
FACULTY$FACULTY_ID = FACULTY_ID
AND
TOPIC$TOPIC_ID = TOPIC_ID
AND
QUESTION_ID = '#Field#' AND ANSWER = '#Val#'
</cfquery>

<cfoutput query="#field#" maxrows="1">
<p>Found <b>#recordcount#</b> faculty members who answered &quot;yes&quot;
to: <br>
Topic: <b>#TOPIC_NAME#</b> <br>
Catagory: <b>#QUESTION_NAME#</b></p>
</cfoutput>

<CFOUTPUT query="#field#">
<p>Name: <b>#FIRST_NAME# #LAST_NAME#</b></p>
<p>Campus Address: #CAMPUS_ADDRESS_1#</p>
<p>Office Phone: #OFFICE_PHONE#</p>
<p>E-mail: <a href="mailto:#EMAIL#">#EMAIL#</a></p> 
<p>School: #SCHOOL#</p>
</CFOUTPUT>

</CFLOOP>

I made a html version of the search form if anyone wants to see it.
http://hs91.ilgard.ohiou.edu/survey/search.html
I am only running the development server that comes with studio so
unfortunately no one but me can see the actual .cfm pages.

Mark and Tobe: Your right -the design is flawed. There are way to many
checkboxes for one page. There are way to many questions in this survey
altogether! This survey was originally sent out in the mail and then mailed
back in and the results were hand entered into excel -if you get my drift; I
was brought in late in the project. I may try to break it up into several
pages instead of one long one.


Thanks again,

Dan
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to