DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: Please help on List Item ... I'm stucked!

  1. #1
    Join Date
    Sep 2001
    Posts
    3
    Hi,
    I created my Data Block (Supply) and Layout (Windows/Canvases) using the Wizard, than I chg one of the control item frm Text Item to List Item (Property Palette -> Item Type). And I added the following code (below) into the WHEN-NEW-FORM-INSTANCE trigger to populate the list:

    DECLARE
    group_id RecordGroup;
    list_id ITEM;
    BEGIN
    group_id := Create_Group_From_Query ('my_group', 'SELECT DeptName FROM Department');
    list_id := Find_Item('DeptId');

    IF (Populate_Group(group_id) = 0) THEN
    Populate_List(list_id, group_id);
    END IF;
    END;

    When I run my form it give me this error:

    FRM-30351: No list elements defined for list item.
    List DEPTID
    Created form file C:\MP3\75131\TEST_LIST_ITEM.fmx

    and this error:

    FRM-41334: Invalid record group for list population.

    What wrong with the code? I tried everything, but none of them work... could someone please help me out, I'm stucked... :(

    Thank You.
    Regard,
    Wai Chong

  2. #2
    Join Date
    Apr 2001
    Location
    UK
    Posts
    137
    An obvious point, but I presume the SQL is valid for the user who is connected to Forms ?

  3. #3
    Join Date
    Sep 2001
    Location
    NJ, USA
    Posts
    1,287
    When you create/populate LIST_ITEM with record group you MUST have 2 elements in each row:
    Data value and list item:

    DECLARE
    group_id RecordGroup;
    list_id ITEM;
    BEGIN
    group_id := Create_Group_From_Query ('my_group', 'SELECT DeptName, DeptName FROM Department');
    list_id := Find_Item('DeptId');
    IF (Populate_Group(group_id) = 0) THEN
    Populate_List(list_id, group_id);
    END IF;
    END;


    SELECT DeptName, DeptName FROM Department
    or
    SELECT DeptName, DeptNo FROM Department

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width