fredborg #1 You keep on finding the parent of the entity passed to the function...Do it like this:Function GetTopOfTree(child) parent = child par = GetParent(child) While par parent = par par = GetParent(parent) Wend Return parent End Function