>>Have you tried using FILE() to check for the file?
>
>Yes, this is a simplified version of the code. In the code here, we have IF FILE()... before ERASE. However, it is so close that even if IF FILE()... succeeds, by the time it reaches the ERASE line, it's too late.
What about using TRY ...CATCH if you are using VFP 8 or ON ERROR in VFP 7 or lower. If one or more users detected the presence of the file, the first one is going to fail to ERASE (then ignore error) , the second should succed...