Article ID: 148332
Article Last Modified on 5/7/2003
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
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
USE customer IN 0 * Customers.dbf and Orders.dbf can be found in VFP\Samples\Data USE orders IN 0 ORDER cust_id SELECT CUSTOMER SET RELATION TO cust_id INTO orders
ThisForm.Text1.ControlSource = "cust_id" ThisForm.Grid1.RecordSource = "orders" ThisForm.Grid1.RecordSourceType = 1
SELECT customer SET RELATION TO thisform.grid1.recordsource='orders' ThisForm.Refresh
select customer use select orders use
Additional query words: kbvfp300 kbvfp500 kbvfp600
Keywords: kbbug KB148332