begin
Screen.Cursor := crSQLWait; 
    with datamodule1, Table1, TreeView.Selected do
        begin
        Close; 
              
        DataSet.CommandText := 'select * from FullList ';
    if AbsoluteIndex > 0 then
    begin 
          
      datamodule1.sidsDeps.Locate('DeptFullName', Text,[]);
          
          
          
          
!!!!!!  DataSet.CommandText := DataSet.CommandText+'WHERE DepID = '+IntToStr(datamodule1.sidsDepsDeptID.AsInteger) +'or Parents starting with';
        if Parent.AbsoluteIndex > 0 then
        DataSet.CommandText := DataSet.CommandText + datamodule1.sidsDepsParents.AsString;
          
          
        DataSet.CommandText := DataSet.CommandText +IntToStr(datamodule1.sidsDepsDeptID.AsInteger) +',';
        end;
    if ckByPoss.Checked then
    
!!!!  DataSet.CommandText := DataSet.CommandText+'order by PosLevel, LastName, FirstName, FatherName'
    else
    
!!!!  DataSet.CommandText := DataSet.CommandText +'order by LastName, FirstName, FatherName';
    Open; 
    Screen.Cursor := crDefault; 
    
  end;