Re: FORMBUILD question???
Posted in 1996
You can use the Master/Detail options, and you can specify in the INSTRUCTIONS section that TableA MASTER OF Table_B. Ecen without that, assuming that Table_A shows up as table 1 (see the top right corner of the screen, under the ring menu) and Table_B shows up as table 2, then you can type 2D when Table_A is current and it will switch to Table_B for you with the rows corresponding to the current one, and you can try M but will probably need to use 1M to go back again. With the INSTRUCTIONS section updated, you don't have to specify the numbers. Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h> }From: kistler@an.hp.com (Jim Kistler) }Date: 5 Feb 1996 22:09:54 GMT }X-Informix-List-Id: <news.20963> } }The following question is directed to the use of the "FORMBUILD" form }generator.....I don't have access to 4GL or ESQL/C! } }I have data from two tables displayed on a single form using a join. } }TABLE_A has rows differentiated by the column "unique_no". } }TABLE_B may have any number of rows where the "no" column value matches the }TABLE_A "unique_no" column value, but each of TABLE_B's "matched" rows will }have a unique "sub_no" column value. } } TABLE_A: TABLE_B: } ---------- ---------- } } unique_no: .... + other_stuff no: sub_no: ... + other_stuff } --------- -- ------ } 1 1 1 } 2 1 2 } 3 1 3 } 4 ------------------------------- } 5 2 1 } . 2 2 }[...] } }To display a given "set" of data, I join TABLE_A and TABLE_B on the form: } } f00 = TABLE_A.unique_no; } = TABLE_B.no; } }and, I always get the FIRST row of TABLE_B displayed, e.g. if I query the }form for TABLE_A.unique_no = 3, I get the row from TABLE_B where sub_no = 1. } }Yes, by then selecting "Table", "Query",.., "Next/Previous" I can ultimately }display all of TABLE_B's rows that result from the specified join, }however...... } } Is it possible to "default" the form's display (via appropriate } attribute selection/etc?) to show some particular row from the } joined TABLE_B for a query of TABLE_A's "unique_no"? } } e.g. If I query the form for TABLE_A.unique_no = 3, I would } like to see displayed from TABLE_B the row where } sub_no = 5, NOT sub_no = 1. } } (The "largest value" of the "sub_no" column is saved in TABLE_A } and is available to "calculate" any of the "sub_no" values } desired - what I really want displayed is the "largest value - 1" } row). } }Any suggestions appreciated ..... } } - I don't have access to 4GL or ESQL/C just FORMBUILD! } }Jim