Deleting Tasks

You now know everything you need to implement the delete tasks functionality. Just add the button to the ClientForm and a DeleteTask method to the DataModule.

Client Form

Delete Button

procedure TClientForm.btnDeleteClick(Sender: TObject);
begin
  ClientDataModule.DeleteTask();
end;

DataModule

procedure TClientDataModule.DeleteTask;
begin
  if tbl_Tasks.BOF and tbl_Tasks.EOF then begin
    Exit;
  end;
  if Application.MessageBox(
      PChar('Delete tasks: '+tbl_Tasks.FieldByName('Task').AsWideString+'?'),Pchar('My Tasks'),
      MB_YESNO + MB_ICONQUESTION) = IDYES then begin
    tbl_Tasks.Delete;
  end;
end;