Subject Re: [IBO] DrawCell method query
Author Lester Caine
I use Builder - but we get the same sort of problems.

> PnlViewAdmin.Visible := True;
> with dmLocalStore do begin
> if not IB_QStockCodes.Active then begin
> IB_QProjOffsEdit.Open;
> IB_QStockCodes.Open;
> IB_QStoneGroupLookup.Open;
> IB_QStoneDescLookup.Open;
> IB_QStockTypeLookup.Open;
> IB_QWareHouse.Open;
> IB_QArea.Open;
> with dmLocalStore do begin
> IB_QStockCodes.DisableControls;
> IB_QStockCodes.Bookmark := qbmStockType;
> IB_QStockCodes.EnableControls;
> end;
> end;
> end;
> irLastPanelView := 1;
> ActiveControl := IB_Grid1;
>
> The panel is set to visible, then the queries are opened... The query in
> question here is IB_QWarehouse... If I move it up the list and open it in
> number 3 position (instead of number 6), there is no error. I think it must
> be asynchrony in the drawing of the grid starting before the queries are
> opened. I shall move them up to before I set the panel visible. If the
> number of queries had been fewer, it may never have shown up as an error
> until perhaps I got a 2GHz CPU machine...

Starting to draw the grid should open the query if it is not
open, but you better off making sure that the bits you need
are open before the grid is drawn.
I have the Open in the 'OnShow' event of the form, and that
works OK.

--
Lester Caine
-----------------------------
L.S.Caine Electronic Services