LOCAL liHouseID, liPersonID, nSelect, nRecno, lOrgTag, lChildFnd * Set the cWorkArea and select the special cursor we use to * lookup by. Also set special form required properties. THISFORM.cWorkArea="PersLook" SELECT PersLook THISFORM.cNavWorkArea="PersLook" * Is special looking up class. THISFORM.cListDialogClass = "frmPersLook" DODEFAULT() * Since frmPersLook is a modal window, following is processed * after the frmPersLook is closed. * Store the items from the lookup cursor we will use to search * the parent and child table with. m.liHouseID = PersLook.HouseID m.liPersonID = PersLook.PersonID * Reset the form to the defaults. THISFORM.cWorkArea="House" THISFORM.cNavWorkArea=SPACE(0) THISFORM.cListDialogClass = "frmDataListForm" * Select parent cursor and find record. SELECT House m.nSelect = SELECT() m.nRecno = RECNO() m.lOrgTag = TAG() SET ORDER TO TAG HouseID SEEK m.liHouseID * Return controlling index to original. IF !EMPTY(m.lOrgTag) SET ORDER TO TAG m.lOrgTag ENDIF * Either accept the new Parent location, or reject * it if the parent was not found. IF FOUND() * Following will update required CodeMine items. THISFORM.cmDataManager.RecordWasMoved('House') * Following finds the correct Child record so that it is selected * when RecordWasMoved is called. It should always be OK to start at first child * record because of RecordWasMoved() above. The .T. parameter * in the following Find() means start search at first child record. m.lChildFnd = THISFORM.cmDataManager.FIND("personid == "+STR(m.liPersonID),"Person",.T.) IF m.lChildFnd = .F. THISFORM.DisplayMessage('The Person record was not found for some reason.') ENDIF ELSE * Record was not found. This should be impossible - but we will inform user * just in case. THISFORM.DisplayMessage('Sorry the House record was not found. Try another.') IF m.nRecno <= RECCOUNT() GOTO (m.nRecno) && Restore record pointer. ENDIF RETURN .T. ENDIF * Refresh Form. THISFORM.REFRESH()As always, your thoughts are appreciated.