>Hi all,
>
>I'm using views for my forms. Each of my table (VFP) has generated primary field. All the indexes whether primary or candidate, the type is regular index. The checking for the primary is done under the hood but it does not check for candidate. So before saving, I tried to SQL Select for the DBF to check whether the similar record with same candidate key exist. However, the SQL Select always return records including the current 1 I'm adding. How do I overcome this?
>
>Thanks in advance.
Farouk,
BEFORE moving the pointer off the new record, check with indexseek().
If you already moved off the record (I mean you went to another row then came back) :
lnKey = myKey
lnRecno = recno()
locate for myKey = lnKey and recno() # lnRecno
llExists = !eof()
PS: SQL select wouldn't work for buffered recs.
Cetin