Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Field validation and duplicate entries
Message
From
27/01/2006 14:27:25
 
 
To
27/01/2006 14:23:47
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 6
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01090901
Message ID:
01091073
Views:
16
>>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.)
Previous
Reply
Map
View

Click here to load this message in the networking platform