close table all use student in 0 use xstud in 0 select student scan if not eof("xstud") replace student.cstud_id with xstud.cstud_id endif endscanThe program only updates 1 record. the first cstud_id from the xstud table updates the correct key in the student table. What am I missing to update the rest of the records? xstud is related to student in the database with a one-to-one relationship. xstud is the table and student is the related table. Do I need to set index on either table. On both tables, I have a primary cstud_key index (aaaa) and an index on the cstud_id (id).