How to populate a multi record block (merged 2) [message #505434] |
Tue, 03 May 2011 02:19 |
|
oracle_qns
Messages: 9 Registered: May 2011
|
Junior Member |
|
|
Hi,
I need help for this situation
i have two blocks called BLOCK1 AND BLOCK2
BLOCK1 is a multi record block with a field, FIELD_A
BLOCK2 is a multi record block with fields FIELD_B,FIELD_C,FIELD_D
i have a button on BLOCK1 called 'FETCH'.
The requirement is when_button_pressed on 'FETCH'
BLOCK2 must be populated for each record of BLOCK1.
Population logic is based on, values from a database table TABLE_A which has got
column values corresponding to all fields of BLOCK1 and BLOCK2.
Please guide me to write this code
|
|
|
|
|
|
Re: How to populate a multi record block (merged 2) [message #505493 is a reply to message #505486] |
Tue, 03 May 2011 06:29 |
|
Littlefoot
Messages: 21818 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Right; well, this is because you would like to change Forms' built-in querying features.
This is how it "normally" goes:- in master block, enter query mode
- enter search criteria
- execute query
- detail records are displayed in a detail block
I think I know what you want - you'd like to enter more than one value in master block and fetch detail records for all those masters. If so, good news for you - you still don't have to code anything (which means: remove the "Fetch" button; master block can be a single record block). You should learn how to use Forms' capabilities. In your case, this is what you have to do:- in master block, enter query mode
- enter ":a" into master block's item (colon + a, omit quote signs). "a" is a variable name, so you can use anything you want. This is just an example.
- execute query
- a new window will be opened. In there, you can write condition that will return desired records. For example, you'd write
:a in ('first_value', 'second_value') where 'first_value' and 'second_value' are values you previously (regarding your previous message) entered into the first and second item in master block
- click <OK>
- detail block will contain all records that belong to both 'first_value' and 'second_value' master block values
|
|
|
|
|
|