Thanks Gerry. I did not know that RLOCK() in this context would lock the current record on disk not the one in the buffer.
I have modified my code to use table buffering and no locking after APPEND BLANK.
[If there is something in this complex form that moves the record pointer then that would trigger a TABLEUPDATE if record buffering is being used. This may have been the reason why occasionally unsaved records were being seen by other sessions.]
--George
>Your APPENDed record is "in the buffer"; by definition, it is already exclusive to you and "invisible" to everyone else until you TABLEUPDATE, or move off the record.
>
>In the current context, you are not locking your appended record (in the buffer), you're trying to lock the "current record" in the
table ...
>
>>The code is very simple:
>>
SET MULTILOCK ON
>>USE CUSTOMER
>>=CURSORSETPROP("Buffering", 3)
>>APPEND BLANK
>>?RLOCK()
>>Now start another session of VFP and run the same code. The lock will fail.
>>
George