>I have a table with a candidate key.
>When I append blank, and delete it, leaving the candidate key field blank.
>
>And when I try to append another blank record, the error msg
>" Uniqueness of Index feildname is violated "
>
>What can I do to overcome this problem?
>Should I set the UNIQUE OFF or ON in the form initialise event, will it help?
Create your candidate index on field FOR !deleted(). Beware that indexes using a FOR clause are not rushmore optimizable, so if this is a large table, adding records will be slowed considerably. To get rushmore optimization in queries though, just create another identical index without the FOR clause.
FWIW, this is why I am usually very cautious about using candidate keys, and I usually take care of checking for duplicates myself in the code that adds records. Currently this has to be done with a second alias of the cursor open to search for the value, but with 6.0 INDEXSEEK() will handle this nicely.
Erik Moore
Clientelligence