>This has reference to a request I had put out earlier re wgere a grid is used to display data from a select into a table. The problem was that when I ran another select to the same table the grid used (same subset of data) the grid disappeared.
>
>I had received many ideas mostly about parametised views (not valid here) and one which I did implement re to create a grid object (class) and re instance that with each new select.
>
>I have since found a better way - the best. It is .NOT. my idea but one I got off the web.Here it is--
>
>Just before the slect all you have to do is set the RecordSource property of the grid to SPACE(0), do the select into the table and then set the RecordSource property back to the table.
>
>Thisform.Grid1.RecordSource = SPACE(0)
>Select .... into a_temp
>Thisform.Grid1.RecordSource = "a_temp"
>
>That is ALL.
>
>Many thanks to all who replied
>
>Bernard
Hi Bernard,
This is the most common method to do it but doesn't give the desired result all the time, especially where columncount might differ. In addition I would suggest setting columncount and all columns(ix).conrtolsource properties through a loop explicitly.
with this
.recordsource = "a_temp"
.columncount=fcount("a_temp")
for ix=1 to .columncount
with .columns(ix)
.controlsource = "a_temp."+field(ix)
endwith
endfor
endwith
Cetin