A grid loses its data when a list box or combo box on a form uses the Requery method in Visual FoxPro (131213)
The information in this article applies to:
- Microsoft Visual FoxPro for Windows 3.0
- Microsoft Visual FoxPro for Windows 3.0b
- Microsoft Visual FoxPro for Macintosh 3.0b
- Microsoft Visual FoxPro for Windows 5.0
- Microsoft Visual FoxPro for Windows 5.0a
- Microsoft Visual FoxPro for Windows 6.0
- Microsoft Visual FoxPro for Windows 7.0
- Microsoft Visual FoxPro 8.0
- Microsoft Visual FoxPro 9.0 Professional Edition
This article was previously published under Q131213 SYMPTOMS
Microsoft Visual FoxPro lets list boxes, combo boxes, and grids within a form to be based on the output of a query (.QPR) file. The list box and combo box
controls support a Requery method. The Requery method causes the query to be updated. The grid does not support a Requery method to update the results of a query. Therefore, if the list box or combo box and the grid are populated with the results of the .QPR file, the grid loses its data when the Requery method is used on the list box or combo box.
RESOLUTION
Set the RecordSource property of the grid back to itself as shown in the following
code:
Thisform.Grid1.RecordSource = Thisform.Grid1.RecordSource
Notes- For an example, see step 7 in the "Steps to reproduce the behavior" section.
- By changing the RecordSource property of the grid, all the properties of the
grid and its columns are set back to their default values. If you must save custom properties of the grid, follow the
workaround that is described in the "References" section.
STATUS
This behavior is by design.REFERENCES
For more information, click the following article number to view the article in the Microsoft Knowledge Base:
140653
A cursor-based grid is blank if the SELECT-SQL command resets the cursor in Visual FoxPro
Modification Type: | Major | Last Reviewed: | 3/17/2005 |
---|
Keywords: | kbBug KB131213 |
---|
|