CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 Row Dependant ListOfValues for ListBox orRadio Buttons

Print topic Send  topic

Author Message
strohtm

Posts: 13
Posted: 02/11/2005, 10:33 AM

I have an editable grid which shows questions needing answered.
I would like to provide a radio button or list box for the user to select their choice.
Each question has a different list of answers.
How can I get the list of values to change per row in the grid.
I have created the following code to generate the list of values.
It however has a few problems.

Dim SQL
Dim RecordSet
Dim ErrorMessage
Dim strAnswers

'Find the answers for each question in the survey
SQL = "select answer from answers where question_id = "&SurveyResaults.Question_id.value
set RecordSet = DBconnection1.execute(SQL)

'Build list of answers
do while not recordset.eof
strAnswers = strAnswers &""& RecordSet(0)&", "
DBconnection1.Execute(SQL)
recordset.movenext
loop
RecordSet.Close
Set RecordSet = Nothing

'assign to list of values
Set SurveyResaults.Answer.DataSource = CCCreateDataSource(dsListOfValues, Empty, _
Array(Array(strAnswers),Array(strAnswers)))

I have tried the code under Before Row Show event.
The answers are pulled from the database but each question's listbox shows the answers for the first question rather then their own questions.

The other problem is that rather then putting serveral options in the list it generates one selection with all of the answers in it.

I have triied the code on the list box's before show even but it dosen't seem to execute. The list box takes its values from the property list.

Any ideas?
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.