See
http://www.craigberntson.com/Articles/kb006.htm>zDatapath = '\\myserver\mydatadir\'
>zDeptCode='12'
>
>SELECT * FROM &zDataPath.myTable ;
>WHERE schoolcode=zDeptCode ;
>INTO CURSOR xTemp
>
>GO BOTTOM
>IF NOT EOF()
> xSubRefno=xTemp.SubRefno+1
>ELSE
> xSubRefno=1
>ENDIF
>
>I need to get the next sequential myTable.subRefNo for a new record I'm appending. But xTemp cursor created with the SELECT statement does not dependably give me the latest updated record though. Many times, a new record appended (& TABLEUPDATEd) just before the codes above is executed, is not reflected in xTemp cursor -- the result being that I get an incorrect SubRefno & when the program tries to save a new appended record with SubRefno -- I get uniqueness of index error because I have duplicate subRefno. Does not happend all the time though -- but most of the time. Sometimes I do get the latest updated table records. Can any body help? Thanks all!
--sb--