FUNCTION RetryLock PARAMETER cAlias, msg * Attempt to lock a record and return .T. if successful. * NOTE: The calling program MUST already have attempted an RLOCK() * IF RLOCK() OR RetryLock() * <replace etc> * ENDIIF * * msg is optional IF EMPTY(m.cAlias) * lock current work area cAlias= ALIAS() ENDIF IF TYPE('m.msg') # 'C' msg= 'The program is currently unable to access a record or file.' ; + 'You can retry now, or cancel and try again later.' ENDIF DO WHILE MessageBox(m.msg, 69, 'File/Record in use by another.') = 4 * User is being persistant! IF RLOCK(m.cAlias) RETURN .T. *<<<<<<<< ENDIF ENDDO * User has given up hope! RETURN .F.That way you'll see if it's failing.