BUG: GRID: SET RELATION TO Does Not Break Relation ProperlyLast reviewed: April 25, 1997Article ID: Q148332 |
The information in this article applies to:
SYMPTOMSWhen you use the SET RELATION TO command to break an existing relationship, the only records displayed from the relationship's child table are those that are related to the current parent record and beyond. Any child records that match parent records prior to the current parent record are left out.
WORKAROUND
Method OneAfter using the SET RELATION TO command to break the relation, use the SELECT command to select the child table, and then use the USE command. This closes the child table. Open the table again by using the USE command. Set the RecordSource property of the grid back to the child alias. The code to do this would look similar to this code:
SELECT orders && Select the child table USE && Close the child table USE orders ORDER cust_id && Open the child table and reset the order ThisForm.Grid1.RecordSource = "Orders" && Reset RecordSource ThisForm.Refresh && Refresh the form Method TwoUse the following code to break the relation. This will allow you to see all the child records in the grid without resetting any of the grid properties. ThisForm.LockScreen = .T. && Lock the form SELECT orders && Select the child table nChildRec = RECNO() && Store the current child record number SELECT customer && Select the parent table nParentRec = RECNO() && Store the current parent record number GO TOP && Go to the top record in the parent table Thisform.Refresh() SET RELATION TO && Break the relation ThisForm.Grid1.RecordSource = ThisForm.Grid1.RecordSource * Force the grid to look at the child table again SELECT orders && Select the child table GO nChildRec && Go to the child record we were on SELECT customer && Select the parent table Go nParentRec && Go to the parent record we were on Thisform.Refresh() ThisForm.LockScreen = .F. && Unlock the form STATUSMicrosoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
MORE INFORMATION
Steps to Reproduce Problem
|
Additional query words: 5.00 3.00 3.00b
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |