EPUB | CHM | PDF

TDataSet.Events.AfterCancel

Top Previous Next

Occurs after an application completes a request to cancel modifications to the active record.

Syntax:

property AfterCancel: TDataSetNotifyEvent;

Description:

Write an AfterCancel event handler to take specific action after an application cancels changes to the active record. AfterCancel is called by the Cancel method after it updates the cursor position, releases the lock on the active record if necessary, and sets the dataset state to dsBrowse. If an application requires additional processing before returning control to a user after a Cancel event, code it in the AfterCancel event.

Example:

This example updates the form's status bar with a message when an AfterCancel event occurs.

procedure TForm1.Table1AfterCancel(DataSet: TDataSet);
begin
  with TDataSet as TMySQLTable do
    StatusBar1.SimpleText := 'Record changes cancelled for ' + TableName;
end;