LOCAL i, nRecNo GOTO bottom && start at the bottom DO WHILE NOT RLOCK() && try to lock the record DOEVENTS && if failed, try again GOTO BOTTOM && always stay at the bottom, the next time it maybe a new record. ENDDO i=id && got the lock, get the its ID nrecno=RECNO() && remember the record number INSERT INTO temp VALUES (i+1,"Test") && insert new record with new ID UNLOCK RECORD (nRecNo) && unlock old recordUnlock the old record after inserting the new record to prevent the other users from using the same ID as you.