boblagatta
|
| Posted: 03/11/2005, 3:46 PM |
|
I have been looking for an answer for what I thought would be an easy task. I may be making it harder than It sould be.
I have and editable grid with 4 columns. In the first column is the question_id and the editable field in the 4th column has a radio control which needs to select only the responses that are applicable for the question_id. I am currently getting all responses available.
For example: When the question_id = 1, only the aolutions from the response table with a question_id of 1 should be listed.
I have searched quite a bit for a possible example but have come up empty. I have tried all of the available joins, DLookups and the like. Any direction would be much appreciated.
Bob
|
|
|
 |
boblagatta
|
| Posted: 03/11/2005, 7:35 PM |
|
I have found that I can limit the information by the WHERE statement in the radio button. I am still having a haed time finding out where to read the variable from each row that is listed on the grid. I am not how to recover this information. Any suggestions?
$this->RadioButton1->ds->SQL = "SELECT * " .
"FROM ep_possible_answers";
When I added WHERE question_id=1 , The values were limited. When I used the radio button, all of the rows were linked together,
Bob
|
|
|
 |
wronco
Posts: 15
|
| Posted: 03/11/2005, 9:05 PM |
|
You could put code in the BeforeShow event of the radio control to determine which elements of the radio control should be shown.
Then, for each row in the grid, you would execute another query to find out which answers should be "active" for that row (ie. the possible answers to the question in the row), and then make the set the Radio control's datasource to be the resulting list.
NB I have not actually tried this...
Will
_________________
http://www.willronco.com |
 |
 |
boblagatta
|
| Posted: 03/12/2005, 11:44 AM |
|
I found the answer from your response. Thank you for your input.
I used the BeforeRowShow function and was able to capture the information in mid stream and then do the SQL search for the "answers" to populate the controls.
Again thanks for the direction it spurred additional thinking.
Bob
|
|
|
 |
|