>>>VFP checks the primary key violation also in the
>>>buffer. So, you can permit changes in the valid
>>>trigger of the item. In that way, VFP doesn't
>>know
>>>there was a primary key violation.
>>>
>>>Sonny
>>>CHCA Informatique
>>
>>So what steps do you take before the user chooses
>>save? What you're saying is that you could check
>>before the user leaves the textbox that contains
>>the primary key. Build you textboxes with a
>custom
>>method that checks?
>
>No, take the valid Method, Check yourself if there
>are duplicate primary key (Try using SELECT SQL or
>an array). If ther is duplicate primary keys,
>return False with a message and the focus will
>stay on that textbox or whatever. If all is
>correct, return TRUE.
>
>METHOD VALID
>
> CHECK PRIMARY KEY
>
> IF DUPLICATE
> =MessageBox('ERROR!')
> return 0
> ELSE
> return 1
> ENDIF
>
>Sonny
>CHCA Informatique
Very good, thank you!
Greg
** ** ** ** ** ** ** ** ** ** **
Gregory Cummines
Visual FoxPro 3.0/5.0
C/C++ Applications
** ** ** ** ** ** ** ** ** ** **