OK. I'll post their KB resolution.
RESOLUTION
To refresh the grid without losing the custom properties of the columns and headers, set the RecordSource property to a dummy cursor that already has been created with the same fields as the cursor the grid is based on. After the SQL SELECT is run, change the RecordSource property back to the rebuilt cursor. This allows the properties of the columns and headers to remain intact while the cursor is being rebuilt.
See the article for the simple code examples.
Main Topics
Browse All Topics





by: CarlWarnerPosted on 2003-04-03 at 09:29:05ID: 8263079
I'm not totally sure I understand your question posed with the information you posted here.
om/default .aspx?scid =kb;en- us; 140653
E=THISFORM .GRID1.REC ORDSOURCE
However, I am gathering that you issued a query that seems to have changed the grid's properties.
From the following MS KB article (ignore the title):
PRB: Cursor-Based Grid Goes Blank If SQL SELECT Resets Cursor
http://support.microsoft.c
SYMPTOMS
If a grid's RecordSource property is set to a cursor, and then the SQL SELECT command resets the cursor, the grid appears blank if the RecordSource property is not set back to itself.
The following command will refresh the grid properly if a SQL SELECT is run to rebuild the cursor, but if the grid's column or header properties have been customized, these customized changes will be lost and the grid's column and header properties will change back to their default settings:
THISFORM.GRID1.RECORDSOURC
Such customization could be headers with different names, longer column lengths, and code placed in the events of columns or headers.
See the MS KB article for the solution, if this condition does in fact apply to you.