Open main menu

RAD Studio Code Examples β

AfterOpen (Delphi)

Contents

Description

This example adds an entry to a memo with a message when an AfterOpen event or an AfterClose event occurs. Populate the ClientDataSet events with CheckButtonActive.

Code

procedure TForm1.CheckButtonActive(DataSet: TDataSet);
begin
  if (Button1.Enabled) then
    Memo2.Lines.Add('Now that the dataset is open, record information is available.')
  else
    Memo2.Lines.Add('Now that the dataset is closed, record information is not available.');
  Button1.Enabled := not ClientDataSet1.Active;
  Button2.Enabled := ClientDataSet1.Active;
  Button3.Enabled := ClientDataSet1.Active;
end;

Uses