Home » Developer & Programmer » Forms » Dynamically populate 2nd drop down list based on the 1st list value (4.5)
Dynamically populate 2nd drop down list based on the 1st list value [message #306382] Fri, 14 March 2008 00:08 Go to next message
D_ashish
Messages: 20
Registered: November 2007
Location: india
Junior Member
Hi All,

Im trying to populate list based on selected value in first list ...like dept in first then in secomd list all employee whos belong to that department would pop up....


i hav written code on first list WHEN ITEM CHANGED
DECLARE


group_id RecordGroup;
list_id Item := Find_Item('MYBLOCK.EMPLIST');
status NUMBER;
rg_name varchar2(40) := 'recgroup';

BEGIN


clear_list(list_id);
group_id := Find_Group(rg_name);
IF NOT id_null(group_id) then
Delete_Group(group_id);
End if;
group_id := Create_Group_From_Query(rg_name,'SELECT ENAME,ENAME FROM EMP WHERE dept=:MYBLOCK.DEPTLIST');

status := Populate_Group(rg_name);
Populate_List(list_id, group_id);

END;

but its not working

Any clues.....

Thanks
Ashish D
Re: Dynamically populate 2nd drop down list based on the 1st list value [message #307455 is a reply to message #306382] Tue, 18 March 2008 23:08 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Why use a dynamic record_group? Just define two items, two LOVs, and two record_groups. Attach each RG to an LOV and attach the LOV to an item. In the second RG refer to the first item.

David
Previous Topic: Problem in form display
Next Topic: Example of Passing record group to Report Builder 6i
Goto Forum:
  


Current Time: Sun Feb 09 21:45:06 CST 2025