Hello,
I have a form with DBGrid which has 3 buttons insert, edit and delete..If I click on delete Form3 opens up and all the corresponding values are displayed in edit boxes.It asks me if I want to delete this record. If I press 'Yes' button. It deletes the record (code written below)
procedure TForm3.Button1Click(Sender: TObject);
var
begin
close;
Form1.DBGrid1.DataSource.DataSet.Edit;
Form1.DBGrid1.DataSource.DataSet.Delete;
Form1.DBGrid1.DataSource.DataSet.Next;
Form1.DBGrid1.DataSource.DataSet.Post;
end;
It actually deletes the record but gives me error message also that 'MSQuery1
ataset not in edit or insert mode'. Can someone pls suggest where is the problem.
Regards
Pooja
I have a form with DBGrid which has 3 buttons insert, edit and delete..If I click on delete Form3 opens up and all the corresponding values are displayed in edit boxes.It asks me if I want to delete this record. If I press 'Yes' button. It deletes the record (code written below)
procedure TForm3.Button1Click(Sender: TObject);
var
begin
close;
Form1.DBGrid1.DataSource.DataSet.Edit;
Form1.DBGrid1.DataSource.DataSet.Delete;
Form1.DBGrid1.DataSource.DataSet.Next;
Form1.DBGrid1.DataSource.DataSet.Post;
end;
It actually deletes the record but gives me error message also that 'MSQuery1
Regards
Pooja