FUNCTION NewID(tcAlias) LOCAL lcAlias, ; lcID, ; lnOldArea lcAlias = UPPER(tcAlias) lcID = 0 lcOldReprocess = SET('REPROCESS') *-- Lock until user presses Esc SET REPROCESS TO AUTOMATIC IF !USED("TABLES") USE data\tables IN 0 ENDIF SELECT tables set order to tablename IF SEEK(lcAlias) IF RLOCK() lcID = tables.nextid REPLACE tables.nextid WITH lcID + 1 UNLOCK ENDIF ENDIF SET REPROCESS TO lcOldReprocess RETURN lcID ENDFUNC ******************>I used pack within the code but i get an error that the table must be opened exclusively. This is a multi-user system and many users will be using it. I don't believe I will be able to open the table exclusively since it is a main table that is used in several places - or can I? Are there any options left? Do you know why VFP doesn't ignore the deleted files and why this command has no affect?