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!

Moving to top of tableframe after edit

Status
Not open for further replies.

mtastad

Programmer
Feb 5, 2002
18
US
I have a tableframe that I am editing (adding/changing records) with objectpal. The table is keyed and if I add a record that flys away to the top of the tableframe, the only way I can see it is if I manually use the vertical scroll bar with the mouse. I have tried various combinations of postrecord() and home(), but this is not working. What am I missing? Thanks...
 
mtastad,

You need to force Paradox to always post a record instead of simply unlocking it when edits are saved. To do this, add the following (or similar) code to the action() event of your table frame's record object:

Code:
if eventInfo.id() = dataUnlockRecord then
   if not active.action( dataPostRecord ) then
      eventInfo.setErrorCode( userError )
   endIf
endIf

The dataPostRecord action forces focus to follow the new record its new position. It's not triggered by default because "fly-away" is only an issue when updating key fields. Extra events get generated when you post changes, as opposed to simply saving them with unlock.

Thus, Paradox's original design team chose to make it an optional action triggered by the user/developer, thereby avoiding the extra performance hit in those cases where it wasn't needed.

Hope this helps...

-- Lance
 
Thanks Lance - I tried this and am still getting similar results. The modified record is above the first record shown in the table frame and the only way I can see it is if I scroll up with the mouse.

I am making the changes to the record through code attached to the "newvalue" method of a radio button - not sure if this makes a difference.

The table I am modifying is a small temp table and the record I want to see will always be the first record in the table. Shouldn't I be able to use the home() method to see this record?
 
mtastad,

You could home the tableframe. If the tableframe object for the temp table is called MYTEMPTABLE then after the endEdit or postRecord, simply add:
MYTEMPTABLE.home(). (To get the tableframe object name, select the tableframe and read the name in the status line at the bottom of the screen).

Padraig
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top