If your form fields are named answer1, answer2, etc. then reference them like this in the query:
#FORM["answer" & i]# Ade -----Original Message----- From: Stuart Kidd [mailto:[EMAIL PROTECTED] Sent: 21 April 2005 20:45 To: CF-Talk Subject: More hash on the mailing list Hi guys, I've got a problem whereby I'm trying to reference my looped variable in an SQL statement. <!-- Update the answers in the database --> <cfloop index="i" from="1" to="#CheckQuestions.recordCount#"> <cfquery name="UpdateAnswers" datasource="user020"> UPDATE tbl_020publicQuestions SET answer = '#form.answer##i#' WHERE interviewID = #CheckInterview.interviewID[i]# </cfquery> </cfloop> My problem appears to be the line SET answer = '#form.answer##i#' - any ideas how I can get this to work? In my form I had answers put into a loop (answer1 answer2 answer3 etc). Thanks, Saturday -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.10.1 - Release Date: 20/04/2005 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:203897 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

