How Oracle table Tip_o could be a controlsource for the textbox?
You can use Debugger to step through the code and see why it fails.
>This code is in field validate method of txtTip control with Tip_o.Tip_obj controlsource.
>The problem is that only when first time invoked it detects properly if any record with
>such value exists. After that duplicate values are not signalized till commit in database.
>(ORA - ...... ). I also modified code and move it in next control Gotfocus event but with
>the same result. Any help appreciated.
>
>*
>LOCAL s, v, _tip
>*
>_tip = ''
>s = 0
>*
>_tip = thisform.txtTip.value
>*
>IF thisform.IsNew('Tip_o')
> IF !empty(thisform.txtTip.value)
> *
> v=SQLEXEC(thisform.oCDE.cdNesto.nConnID,;
> "Begin SELECT COUNT(*) into ?@s from Tip_o Where Tip_o.TIP_OBJ=?@_tip;End;")
> *
> IF s > 0
> thisform.oCDE.DisplayMessage('Tip exists ! - '+STR(s,2)+' '+_tip )
> RETURN .F.
> ENDIF
> *
> ENDIF
>*
>ENDIF
>
>
>Regards, Gojko
>
>PS
>(BTW: How do you earn code rows to be on light blue background and intended ?)
--sb--