>>The most obvious problem (IMO), is that there is no "error-handling"; ie. there is no testing of return codes from RLOCK() or TABLEUPDATE() which would indicate whether or not an operation was successfull or not.
>
>I did NOT write, but I need to fix it.
>
>Can you please give me some pointers on what needs to be changed, i.e either code snippets or where to get the information on the necessary error checking and anthing else I need to do.
I would just add some "defensive programming" to start with.
Instead of simply RLOCK(..), code an IF .. ELSE ... eg.
IF !RLOCK(..)
= MESSAGEBOX( "Record in use. Please try again" )
RETURN
ENDIF
...
IF !TABLEUPDATE(..)
... some error processing ...
RETURN
ENDIF
Look up RLOCK(), TABLEUPDATE() and AERRORS() in Help for more information.
Taking it one step at a time avoids being overwhelmed. If you provide some feedback to the User on why an update failed, then they can then help you with the problem. You might even add a temporary "record updated" success MESSAGEBOX if it helps to assure you that the "transaction update" code is actually being executed.