INSERT INTO Company ( CompanyName ) VALUES ( 'Fred FlintStone' ) IF TABLEUPDATE( 0, .F., 'Company' ) *** Construct the node for the new record lcKey = 'COMPANY*' + TRANSFORM( CompanyID ) *** Find out where this node belongs SKIP -1 in Company IF BOF( 'Company' ) *** Insert it in front of all the other nodes Thisform.oTree.Nodes.Add( , tvwFirst, lcKey, Company.CompanyName ) ELSE lcSiblingKey = 'COMPANY*' + TRANSFORM( CompanyID ) Thisform.oTree.Nodes.Add( lcSiblingKey, tvwNext, lcKey, Company.CompanyName ) ENDIF ENDIF