Hi!
Use the grid reconstruction behaviour ;)
Tr following code and let us know if it works:
select (Grid.RecordSource)
use
Grid.ColumnCount = -1
Grid.RecordSource = "NewAlias"
Grid.Refresh
More about grid reconstruction you can read in the VFP Grids article in the UT magazine, August issue.
HTH.
>I have a command F3 "change grid form" in my form.
>This command destroys all grid columns and then adds new columns to grid.
>
>To destroy columns I use
>
>
> this.gridbase1.columncount = 0
>
>
>I tried also
>
>
> DO WHILE this.gridbase1.columncount>0
> this.gridbase1.DeleteColumn
> ENDDO
>
>
>Using those commands in VFP 7 will cause C5 error sometimes. This works in VFP 5.
>
>Is there a way to re-create grid columns to avoid C5 error ?
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.comICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs
It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.