>This is i problem I have been fighting with for a very long time and newer got any good solutions... When i'm working with a grid I often create a temporary table (in dataenvironment.beforeopentables) which I edit in grid. So far so good. The problem is when i'm moving around in the "real" table and need to update my temporary table with new records. My forms refresh method looks something like this:
>
>select tempgridtable
>zap
>select realtable
>scan for....
> insert into temptable ....
>endscan
>
>If any object except the grid has the focus when i'm doing form.refresh() everything is fine and all the records shows correctly. But if the grid has the focus then the grid becomes empty. Why?
>
>The problem only seem to occurs when grid.RecordSourceType = 1 (Alias)
>
>Can somebody help me out here?
>
>/Mårten Törnquist
Mårten:
The same thing heppens to me. This is, I believe, a known VFP bug. The workaround is to move focus away from the grid before the form refresh. Usually I put code in form refresh() to (1) set .lockscreen = .T., (2) check for focus. (3) if focus is in the grid, move the focus (4) dodefault() to refresh the form, (4) If focus was in the grid, set focus back to the grid, (5) unlock the screen.
This seems to do the trick.
regards,
Jim Edgar
Jurix Data Corporation
jmedgar@yahoo.comNo trees were destroyed in sending this message. However, a large number of electrons were diverted from their ordinary activities and terribly inconvenienced.