Friday, October 12, 2007

How to create the Delete button

How to create the Delete button

To create the Delete button

Step 1

To create the Delete button, first, add the Button in the Form1 and then rename the Caption to Delete.

Step 2

Next, just double click the Button to show the Code Explorer Window and you need to set the Program as followed;

  1. Table1.Delete;
  2. procedure TForm1.Table1BeforeDelete(DataSet:TDataSet);
  3. begin
  4. if messagedlg(' You want delete the data ',mtinformation,[mbyes,mbno],0)
  5. =mrno then abort();

  6. end;

Step 3

Now, you need type and insert the code and set the Program as followed;

procedure Table1BeforeDelete(DataSet: TDataSet);

No comments: