Subject tib_grid display on query rerun
Author stanw1950
My tib_grid's source is a tib_query. If the user changes a where
condition (in a radio group), then the query must be rerun. The code
is below. If I don't UnPrepare it, then the onprepareSQL procedure
won't run, which is where the "wheres" are set up. When the query is
run the grid goes blank (including the column titles) for the time it
takes to run. This is visually distracting. I've tried various
combinations with disable/enable controls and begin/end busy, but
nothing seems to stop the blanking out of the grid. Any suggestions
would be greatly appreciated. Thanks. (D6, IBO4.2.fn)

with qry do begin
DisableControls;
//BeginBusy(False);
try
if Active then Close;
if Prepared then UnPrepare;
//the wheres are set up in the qryPrepareSQL procedure
ParamByName('ID').AsInteger := DataId;
Open;
finally
//EndBusy;
EnableControls;
end;
end;