|dynamic selection of records based on checkbox checked [message #78028]
||Fri, 04 January 2002 11:20
Registered: October 2001
I want to select a list of records from a multirecord block by using the checkbox checked values as the criterion and use the records selected in the where clause for querying in another forms. The data from the multirecord block is from a query result and hence is dynamic.
I went about doing this:
I created a multirecord block. In the multirecord block, I created a checkbox which was a non-database item.
In the when_button_pressed trigger I wrote the following code:
for i in start_rec..stop_rec loop
if :selection='Y' then --selection is the checkbox
if item_value is null then
/*item_value holds the value of the data shown in the forms & for which the checkbox is checked*/
/*patient_id is the item name as well as field name in the table*/
When I run this form, patient_list comes as
(111,111,111,111,111,111,111) where 111 is the value of the patient_id.
The only value that gets into the patient_list is the patient_id for the last checkbox I have checked in the forms and the same patient_id appears so many
Can anyone tell me where I am doing the mistake? Why is the same value appearing so many times and only the last record selected appears in the patient_list.
Thank you for your suggestions and your help.