Hola Mauricio ---
I wouldn't use filter to filter out deleted records to support primary key index...not good form, so to speak. Just pop a new number of whatever counter you're using. If the int or num field is large enough, this shouldn't be a concern.
>I Create a Table with a field X that is a primary key.
>
>I Input a record with X=1
>Delete the record, set deleted is on
>
>When I Insert record with X=1 again, Foxpro show the error: Unique index violation.
>
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05