>Hi Jim,
>I am not using TRANSACTION but unfortunately two threads have been running on the issue and I think that after 3 hours and about a million suggestions, the only way to check if a record is being viewed is to create a table track who has what open.
>
Ian- I think that you are really close to snagging this, you just need to get your logic in the right order. If everybody is accessing the tablew through the same interface, then you can enforce RLOCK as a read-only mechanism. Like Jim showed you, you want logic like:
IF RLOCK()
* You got the record, locked it, and you have full access to it.
ELSE
* Somebody else has it, because your lock failed.
ENDIF
When you are done with the record, UNLOCK it, and this will allow the next guy to edit it. Your MULTILOCKS setting will be of importance here, and you will need to decide how many records a user should be able to LOCK at once. Keep in mind that if you issue SET MULTILOCKS at any time while any records are locked, they will all be unlocked.
You have probably already looked into it, but you'll also need to pay attention to SET REPROCESS. The default is 1, meaning that VFP only tries once to lock the record, and then gives up. This is probably what you want, I am only bringing it up in case any of your other code has already set it to 0 or AUTOMATIC. Good Luck.
PS, I forgot to include you in the other response, but look at my response to Nancy regarding ISRLOCKED(). The same goes for ISFLOCKED().
Erik Moore
Clientelligence