>I am creating a cursor in the load event of my form. The cursor is the record source for my grid & the record source type is set to 1. My form displays correctly for the first record, but when the cursor is rebuilt the grid box disappears & displays as a white rectangle. My cursor is rebuilding with the correct records & I am refreshing the grid. Why does the grid disappear & not refresh?
>
>TIA for any suggestions. :)
When you overwrite cursor (e.g. by running new SELECT-SQL) vfp thinks that you created completely new recordsource and kill old one and clean-up the grid. To avoid you can use two ways: either
1. Don't override cursor. You can instead SELECT INTO another cursor/array and APPEND/INSERT to existing cursor from new one.
or
2. Restore grid setting programmatically after each cursor overriding:
Select ... Into cursor tmp
Grid.RecordSource="tmp"
Grid.Refresh
This way you will be also committed to resetting specific Column properties (ControlSource, Width, etc.)
Edward Pikman
Independent Consultant