I am trying to delete multiple records selected via checkbox at TDBAdvGrid. My Code is as follows

Code:
procedure TForm5.Button3Click(Sender: TObject);
var
     i,j,idn: Integer;
     State: Boolean;
begin
  j := 0;
  for i := 1 to DBAdvGrid1.RowCount - 1 do
  begin
    if DBAdvGrid1.GetCheckBoxState(1,i,state) then
    begin
      if state then
      begin
        idn := StrToInt(DBAdvGrid1.Cells[6,i]);
        UniQuery1.SQL.Text := 'Delete from userplays where id = :id';
        UniQuery1.ParamByName('id').AsInteger := idn;
        UniQuery1.ExecSQL;


      end;
    end;
  end;

end;
It is deleting only first record in lineup. After deleting first record it breaks for loop and control goes back to TDBAdvGrid with updated data after delete.

How to delete multiple records ?