Select student Set Order To CODE Set Filter To admtd=1 Goto Top Do While !Eof() grno = code mscode = scode mlcode = lcode msec = sec Select dly Set Order To CODE Seek grno If Found() Select student Skip Else Select dly Append Blank Replace code With grno Replace date With pdate Replace type With 1 Replace category With "P" Replace scode With mscode Replace lcode With mlcode Replace sec With msec Select student Skip Endif Enddo Endif Endif