Forms4.5 - Dynamic Listbox Manipulation for Detail block

From: Vijay Damodaran <vijayd_at_nortel.com>
Date: 1997/06/26
Message-ID: <33B2B990.2E0E_at_nortel.com>#1/1


Hi,

I appologize for the lengthy mail, but I hope to provide as much detail as possible so that u can understand what I am trying to do.

I am trying to create a Master-Detail Block as follows:


           Activity ID: _________ (format is AAnnnn)

  +------- Detail Block --------------------+

| |
| From_Activity From_Milestone |
| |
| 5 records in this detail block |
| Each column is a Combo-box. |
+-----------------------------------------+ Insert_Button Delete_Button (calls create_record) (calls delete_record) ==========================================================
The listbox for From_Activity is static. The listbox in From_Milestone is dependent on the value of the item selected from the From_Activity listbox. I do this from a 'When-List-Changed' Trigger in the From_Activity item.

Assuming the foll. data:

	Activities: GR1001, GR1002, GR1003.
	Milestones for GR1001: WS, WD
	Milestones for GR1002: DS, DC, CI, LA
        Milestones for GR1003: FR, DC, LA

So, the From_Activity listbox will contain GR1001, GR1002 and GR1003.

This is what I do when I execute the form:

  1. Insert a new record by clicking on Insert_button. When-Create_record Trigger is fired which populates the From_Activity listbox.
  2. I then select GR1003 from From_Activity Listbox. The When-List-Changed Trigger goes to the database and returns the milestones for GR1003 and populates the From_Milestone Listbox. So the list contains FR, DC, LA.
  3. I select DC from the From_Milestone Listbox.
  4. Now I create a new record by executing step 1.
  5. Now I select GR1001 from the From_Activity Listbox. The When-List-Changed Trigger goes to the database and returns the milestones for GR1001 and populates the From_Milestone Listbox. So the list contains WS, WD.
  6. I select WS from the From_Milestone Listbox.

Now at the end of step 6, I have 2 records.   Record 1: GR1002, DC, From_Milesone Listbox: FR,DC,LA   Record 2: GR1001, WS, From_Milesone Listbox: WS,WD The items in both From_Activity Listboxes in both records are the same.

BUT, when I go to select a milestone from the From_Milestone listbox in Record 1, I find the listbox has
been replaced by the listbox in Record 2. So, now I have the From_Milestone listbox items as WS, WD for both the records.

How Can I implement the detail blocks in a manner that when I go to the From_Milestone listbox, the items in the listbox correspond to the selected item from From_Activty listbox?

Any tips will be greatly appreciated.

BTW, I am using Forms4.5 in Motif platform.

Thanks,

VJ.

-- 
Vijay Damodaran
vijayd_at_nortel.com
Work: (972) 685-8150
Received on Thu Jun 26 1997 - 00:00:00 CEST

Original text of this message