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

leave record method

Status
Not open for further replies.

ameedoo3000

IS-IT--Management
Sep 20, 2016
233
EG
hi all
i want to know the what is the event of leave record in the grid?
i want to put commands in this event

Greetings
 
It's BeforeRowColChange or AfterRowColChange, but for events you want to run when leaving a record use BeforeRowColChange, because AfterRowColChange only happens, when you not only leave a row in the grid, but activate another row, too, after that row os activated.

Sometimes you need to use both events for code you want to run, because when changing from controls outside the grid to the grid, only AfterRowColChange happens. The events only happen as pair of events, when you change from one row or column to another and stay within the grid.

Also, if you only change column, the Rownumber will be the same. That makes it a bit hard to use it for row change events overall, as it also can happen when the row has not changed.

Bye, Olaf.
 
thank you very much Olaf
I achieved my goal but there is error message appear and i want to disappear it. how that?
Untitled_had4jc.png

and automatic chose with Revert. how that?
 
You can't add an empty row, that means you have to create new rows with a primary key.
An essential property for a view or cursor adapter to store data into the base table is having the primary key.
So you can forget about anything involving APPEND BLANK, unless you do that on the base tables and load it into the cursor instead of the way you seem to do it now by adding it to the cursor and wanting to store it into the base tables from there.

If you're willing to change to GUID, you can design a view or cursor adapter to have the primary key field as updatable field at the same time, having a default value of a function creating a GUID and when adding a new record into the view cursor or cursor adapter cursor you add it with a GUID you create by calling that default function yourself, see or
Just notice overall: The view or cursor adapter represents the base table, but it isn't the base table, it does not inherit default values and other base table properties like field captions or rules or triggers. So all you have only at the base table level rather needs extra code or you do it at the base table level. You can pretty much forget to be able to add new records via view/cursor adapter for tables with an autoinc integer, for example, as such a field type is readonly and has to be created at the base table itself.

Last not least, your idea to ignore the error by automatic answer of revert won't work. Revert in this situation means removing the new record, that's not what you want. Of course that solves the problem with the empty record, but not as you think by ignoring it, it will be removed.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top