>In VFP5 how do I detect if another user has deleted the current record when table buffering is used?
Dan,
I have used a couple of simple methods which seem to work
1. Search for the recno of the record to be deleted
lrecno = recno()
select recno() from MYTABLE where recno()=lRecno into cursor TEMP
if _tally = 0..................
2. create a UD method to include something like -
local lRecno,lRecno2,lSame
lSame=.t.
&& Save the record number of the record displayed
lRecno=recno()
&& Skip forward and back to the current record
ThisForm.LockScreen = .t.
skip
skip -1
&& Save the record number of the current record
lRecno2=recno()
&& If the two recnos are different then the record you were on has been deleted
if lRecno<>lRecno2
lSame=.f.
endif
ThisForm.LockScreen = .f.
return lSame
If the check is to be done at TableUpdate stage trap for error 1585 - 'Update conflict' and use 1. to confirm if it has been deleted.
HTH.
Glenn
DOE(NI), Belfast