PRB: SET RELATION TO Has No Effect in Grid from ChildLast reviewed: January 10, 1997Article ID: Q156030 |
The information in this article applies to:
SYMPTOMSIf you create a form containing a grid whose record source is a child table in a relation that is broken with the SET RELATION TO command, the grid behaves as if the relation were still set and continues to show a subset of records from the child table.
CAUSEFor performance reasons, the relation information is cached and is not reread until the grid is forced to reevaluate its record source.
WORKAROUNDSet the grid's record source to the grid itself to clear the cached information and to force the grid to reevaluate its record source, as in the following example:
Thisform.Grid1.RecordSource = Thisform.Grid1.RecordSourceAdditionally, setting the grid's record source to itself does not cause the grid to lose nondefault properties as it did in Visual FoxPro 3.0b.
STATUSThis behavior is by design.
MORE INFORMATION
Steps to Reproduce Behavior
To incorporate the workaround into this example, add the following code as the third line of the Click method of the command button on the form created above:
Thisform.Grid1.RecordSource = Thisform.Grid1.RecordSourceRun the form, and click the button. The grid updates to show all child records.
|
KBCategory: kbprg kbprb
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |