Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


leave record method

leave record method

leave record method

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


RE: leave record method

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.

RE: leave record method

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

and automatic chose with Revert. how that?

RE: leave record method

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 http://fox.wikis.com/wc.dll?Wiki~GUID or http://fox.wikis.com/wc.dll?Wiki~GUIDGenerationCod...

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.

RE: leave record method

thank you very very much Olaf

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close