2 Replies Latest reply: Jul 17, 2000 10:42 AM by 3004 RSS

    poplist ?

    3004
      i have a poplist field that when populated dynamically will show the last few results from the record group and not the first results. i use the populate_list built in does anyone know why this happens and any sugestions on a solution? we are using
      forms6.
      thanks
        • 1. poplist ?
          3004
          Chad,

          Let me understand if this is what happens - you have a pop-list that shows loads of values, and the cursor is always at the last one rather than at the very first value. Is that correct? And you want the cursor to be on the first value in the pop-list? If so, then this is what you do. You have to fool the pop-list. You have to retreive the first value (that appears in the pop-list) from the database and place it in the field, and THEN fire the populate_list command. I have a field called PROJ_CODE and the following code in the WHEN-MOUSE-CLICK button for that field caters for this problem....


          /* THIS CODE ENSURES THAT THAT WHEN THE USER GOES TO THE POP-LIST
          THEN THE CURSOR IS ALWAYS ON THE VERY FIRST ITEM OF THE LIST
          AND NOT ON THE LAST ROW */

          DECLARE
          v_desc varchar2(30);
          v_code varchar2(8);

          CURSOR C1 IS
          select b.pro_desc, a.proj_code
          from project_users
          where proj_user = :blk_main.t_user
          and a.closing_flag = 'N'
          order by a.pro_desc;
          BEGIN
          open c1;
          fetch c1 into v_desc, v_code;
          close c1;
          --
          if :blk_detail.proj_code is null then
          :blk_detail.proj_code := v_code;
          end if;
          END;

          Hope this helps...
          Harry
          null
          • 2. poplist ?
            3004
            thanks harry that is exactly my problem