anchor.diff:    i : integer;
   begin
     FInstantQueryManager := aInstantQueryManager;
  -  FDatasetProvider.Init(FInstantQueryManager.GetDataProvider);
  -  FInstantQueryManager.GetDataProvider.FillVirtualFieldDefs(FDatasetProvider.VirtualFieldDefs, '');
  -  FVirtualDataset.Active:= true;
  -  FVirtualDataset.Refresh;
  -  fields := TStringList.Create;
  +  FInstantQueryManager.Clear;
  +  FGrid.DataSource.DataSet.DisableControls;
     try
  -    if aFieldNames <> nil then
  -      fields.AddStrings(aFieldNames)
  +    FDatasetProvider.Init(FInstantQueryManager.GetDataProvider);
  +    FInstantQueryManager.GetDataProvider.FillVirtualFieldDefs(FDatasetProvider.VirtualFieldDefs, '');
  +    FVirtualDataset.Active:= true;
  +    FVirtualDataset.Refresh;
  +    fields := TStringList.Create;
  +    try
  +      if aFieldNames <> nil then
  +        fields.AddStrings(aFieldNames)
  +      else
  +        FInstantQueryManager.GetDataProvider.GetMinimumFields(fields);
  +      for i := 0 to FVirtualDataset.Fields.Count - 1 do
  +      begin
  +        if fields.IndexOf(FVirtualDataset.Fields[i].FieldName) < 0 then
  +          FVirtualDataset.Fields[i].Visible:= false;
  +      end;
  +    finally
  +      fields.Free;
  +    end;
  +    FDisplayFieldNames.Clear;
  +    if aDisplayFieldNames <> nil then
  +      FDisplayFieldNames.AddStrings(aDisplayFieldNames)
       else
  -      FInstantQueryManager.GetDataProvider.GetMinimumFields(fields);
  -    for i := 0 to FVirtualDataset.Fields.Count - 1 do
  -    begin
  -      if fields.IndexOf(FVirtualDataset.Fields[i].FieldName) < 0 then
  -        FVirtualDataset.Fields[i].Visible:= false;
  -    end;
  +      FInstantQueryManager.GetDataProvider.GetMinimumFields(FDisplayFieldNames);
  +
  +    FKeyFieldName:= aKeyFieldName;
  +    if FKeyFieldName = '' then
  +      FKeyFieldName:= aInstantQueryManager.GetDataProvider.GetKeyFieldName;
     finally
  -    fields.Free;
  -  end;
  -  FDisplayFieldNames.Clear;
  -  if aDisplayFieldNames <> nil then
  -    FDisplayFieldNames.AddStrings(aDisplayFieldNames)
  -  else
  -    FInstantQueryManager.GetDataProvider.GetMinimumFields(FDisplayFieldNames);
  -
  -  FKeyFieldName:= aKeyFieldName;
  -  if FKeyFieldName = '' then
  -    FKeyFieldName:= aInstantQueryManager.GetDataProvider.GetKeyFieldName;
  +    FGrid.DataSource.DataSet.EnableControls;
  +  end;
   end;
   
   procedure TmLookupPanelInstantQuery.SetFocusOnFilter;
  
positive.code: implementation
  
  uses
    Variants;
  
  { TmLookupPanelInstantQuery }
  
  procedure TmLookupPanelInstantQuery.OnClickSearch(aSender: TObject);
  begin
    if Assigned(FInstantQueryManager) then
    begin
      FInstantQueryManager.FilterDataProvider(FEditText.Text);
      FVirtualDataset.Refresh;
      FGrid.AutoAdjustColumns;
    end;
  end;
  
  
negative.code: constructor TmLookupPanelInstantQuery.Create(TheOwner: TComponent);
  begin
    inherited Create(TheOwner);
  
    FDatasource := TDataSource.Create(Self);
    FVirtualDataset := TmVirtualDataset.Create(Self);
    FInstantQueryManager := nil;
  