var tempAllId:string; i:integer; begin with dbgrid1.DataSource.DataSet do begin for i:=0 to dbgrid1.SelectedRows.Count-1 do begin if i>0 then tempAllId:=tempAllId+','; GotoBookmark(pointer(DBGrid1.SelectedRows.Items[i])); tempAllId:=tempAllId+fields[0].Text; end; end;