Getting more than one record

Hi, i´ve the following problem: f.e. 2 Tables, Customer, Mail-Account. 1 Customer, N Mailaccounts. Now i have to write a new record in another table where the Mailadresse are written in one row… Name, Mail1, Mail2, Mail3… Thanks for help Michael

U R velcome… [:D] I would expect that there can be any number of mail-adresses attached to the individual customer. (this is why you write “N mail-adresses”, right). Then I must ask you: How many “mail-adrN”-fields is there in your “other table”? If you stop at “mail-adr10” and the customer has 11 mail-adresses, which one is then not writen in the “other table”. regards Alexander

A suggestion if Customer.FIND(’-’) then begin NewTable.“Customer No.” := Customer.“No.”; NewTable.“Name” := Customer.Name; repeat MailAccount.setfilter(“Customer No.”,Customer.“No.”); MailCount := 0; if MailAccount.FIND(’-’) then repeat MailCount := MailCount + 1; MailDetail := MailAccount.Address +’ '+MailAccount.“Address 2”… case MailCount of 1 : NewTable.Mail1 := MailDetail; 2 : NewTable.Mail1 := MailDetail; etc. end; until (MailAccount.Next = 0) or (MailCount = MailLimit); If not NewTable.INSERT then NewTable.MODIFY; until Customer.NEXT = 0; end; MailCount, MailLimit, Mail Detail are variables; MailLimit is the number of addresses allowed in your new table (NewTable)