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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Keeping the focus on a line 1

Status
Not open for further replies.

hpaille

Programmer
Apr 16, 2003
37
FR
Hi,

I call a module from a screen where I have the focus on a specific line. In the module called I do a treatment that will update the caller. When I come back to the caller I do an execute_query to refresh the data, but doing so, I lose the focus on the line. How can I store and reapply the focus ?

Forms 6i

Thanks in advance
 
Why don't you just prepare changes in called module and apply them in calling one? There's no generic way to keep position, because between requests your record may be updated by somebody else, or even deleted. Of course you may save PK value(s) and fetch records (using NEXT_RECORD) untill you reach it, but in general this is not encouraged.

Regards, Dima
 
Assuming your calling form block is multi-row, before you call the execute_query you need to store the current record number and the bottom record number.

Code:
current := :SYSTEM.CURSOR_RECORD
bottom := TOP_RECORD + RECORDS_DISPLAYED - 1 (from block properties)

Then after the execute_query:

Code:
Go_Record(bottom)
Go_Record(current)

As Sem says though, it wont necessarily be the same record if others have been created or deleted.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top