PRB: Grid Not Refreshing Displaying a Cursor From QueryLast reviewed: February 6, 1997Article ID: Q131836 |
The information in this article applies to:
SYMPTOMSIf a Grid's RecordSource property is set to a cursor and that cursor is updated at run time by using a "SQL Select Into Cursor <CursorName>" command, the grid does not display any data even if you Refresh it by using the ThisForm.Refresh or ThisForm.<GridName>.Refresh command.
CAUSEWhen you execute a SQL Select statement into the same cursor specified in the grid's RecordSource property, the original cursor has to be destroyed before the new cursor can be created. When this happens, the grid columns and the RecordSource are also cleared and then re-created. The grid's record source is set to the new cursor, and the grid automatically creates columns. The new grid is working from scratch, so it does not load the data from the cursor.
RESOLUTIONTo refresh the grid in this situation, set the Grid's RecordSource property to itself as in this example:
thisform.grid1.recordsource=thisform.grid1.recordsource STATUSThis behavior is by design.
MORE INFORMATIONFor more information, please see the following article in the Microsoft Knowledge Base:
ARTICLE-ID: Q140653 TITLE : PRB: Cursor-Based Grid Goes Blank If SQL SELECT Resets Cursor Steps to Reproduce Behavior
To have the grid display the data correctly, place the following command as the last line of code for the Click event of the command button:
ThisForm.Grid1.RecordSource =ThisForm.Grid1.RecordSource |
KBCategory: kbprg kbprb
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |