lparameters tcCustomerID local lnSelect, lcSelect, lcPhones, loDatabase lnSelect = select() if not used('curEmails') lcSelect = "select cID, Phone, Type from Phones " + ; "where Type LIKE 'E-mail%' and Phone <> space(60)" loDatabase = SQApplication.DataEngine.Databases.GetMainDatabase() loDatabase.ExecuteSQLStatement(m.lcSelect, , 'curEmails') select curEmails index on cID tag cID endif lcPhones = '' select curEmails set order to cID if seek(m.tcCustomerID) scan while cID = m.tcCustomerID lcPhones = m.lcPhones + iif(empty(m.lcPhones), '', chr(13) + chr(10)) + trim(Phone) + ' ' + strtran(trim(Type),"E-mail","") endscan endif select (m.lnSelect) return m.lcPhonesDo you know what could be wrong?