procedure TForm5.wwDBGrid1TitleButtonClick(Sender: TObject;
AFieldName: String);
var Nu: integer;
begin
Application.ProcessMessages;
nu := form1.ADOTable2.fieldbyname('IdEmployees').AsInteg er;
Memo1.Lines.Add(inttostr(Nu));
if (AFieldName <> 'RecNu')and(OnMoveColu = false) then
if (form1.ADOTable2.Sort <> '')and (Copy(form1.ADOTable2.Sort,length(form1.ADOTable2. Sort)-2,3)='ASC') then
form1.ADOTable2.Sort := AFieldName + ' DESC' else
form1.ADOTable2.Sort := AFieldName + ' ASC'
else OnMoveColu := false;
form1.ADOTable2.Locate('IdEmployees',nu,[]);
end;