loParents = FindParents("AccountType") For ix = 1 To loParents.Parents ? loParents.aParent[m.ix].ParentAlias, loParents.aParent[m.ix].RelationalExpr Endfor Function FindParents(tcChild) Local Array aTables[1] Local ix,jx, oParentInfo, lnParents oParentInfo = Createobject('Empty') AddProperty(oParentInfo,'Parents',0) AddProperty(oParentInfo,'aParent[32767]') For ix=1 To Aused(aTables) For jx=1 To 32767 If Empty(Relation(m.jx,aTables[m.ix,1])) Exit Endif If Target(m.jx,aTables[m.ix,1]) == Upper(m.tcChild) oParentInfo.Parents = oParentInfo.Parents + 1 oParentInfo.aParent[oParentInfo.Parents] = Createobject('Empty') AddProperty(oParentInfo.aParent[oParentInfo.Parents],; 'ParentAlias',aTables[m.ix,1]) AddProperty(oParentInfo.aParent[oParentInfo.Parents],; 'RelationalExpr',Relation(m.jx,aTables[m.ix,1])) Endif Endfor Endfor Dimension oParentInfo.aParent[MAX(oParentInfo.Parents,1)] Return oParentInfo EndfuncCetin