>>Put a command to check the cust_no in the database on lost focus event of the control and prompt a message if not unique.
>
>Thanks Marc. I tried that with the following code in the Lost Focus event:
>
>seek this.value
>if foun()
> retu .f.
>else
> retu .t.
>endi
>
>And I entered a cust_no that's already in use and got the same message: "Uniquness of index CUST_NO is violated."
>
>This really oughta be simple. In fact, I'm sure it IS for all of you. :) I just don't know what I'm not seeing here...
Not a fix to your problem, but your six lines can be replaced by one:
Return Seek(this.value)
It may be even faster to use IndexSeek
Return IndexSeek(this.value,.F.)