Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Forms - Capturing the next value in a tabular block

Status
Not open for further replies.

thebull1

Programmer
Oct 24, 2001
68
I have a tabular block with many records retrieved. I am modifying a value on say record number 5. At its post-change, I need to access the value on record 6 so I can get their difference. How do I capture that value on record 6??
 
I would generate a record group in a POST-SELECT trigger following the query using the same where clause and order by from :SYSTEM.LAST_QUERY.

Then you can read the value of the next record using something like

Get_Group_Number_Cell('<group.cell>',To_Number:)SYSTEM.TRIGGER_RECORD) + 1);
 
I have used a view which is being populated by a cursor, so it does not have a query as such.. how will I create a record group that I can use at post change of one of the cells?
 
Check out my answer in your other thread. Theres plenty of help in the forms help system on this subject.

Let me know how it goes.
 
Thanks Lewisp.
I have now managed to capture a value in the consecutive record. However I cannot be able to update it at the post_change of the current item. It is only posible if I use a trigger like clicked, key_next_item or key_prev_item which is not right coz I cannot predetermine what action the user will take, and the use of these key-triggers seems to be over-riding what the key is supposed to do. Please assist...
 
The problem is you are trying to navigate using a restricted built-in procedure, which will give you an error.

Wont this method mean that you have to cascade the changes down the whole list from the current record (having looked at your new thread)?

You would write a procedure to do the cascade from the current point until you hit :SYSTEM.LAST_RECORD = 'TRUE'. Then in your key-nextitem (for example) put code like this:

current_rec := :SYSTEM.CURSOR_RECORD;
Validate(ITEM_SCOPE);

IF FORM_SUCCESS
THEN
call_cascade_procedure;
Go_Record(current_rec);
END IF;
 
Thanks Lewisp..
You are right that what I want to do here might not be possible. I have instead decided to do all these post-change computations after the user has saved the readings to the database. He is fine with that..
Thanks again..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top