REPLACE repcode WITH STUFF(repcode,AT('lSummary',repcode)+12,1,'T') REPLACE repcode WITH repcode + 'cDbf = "Fred.dbf"'+CHR(13)Easy isn't it? Changing the way you use spaces between records will however screw things up nicely. To cope with this, more coding is needed.