Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Field valid - works only first time
Message
From
16/01/2006 09:24:12
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Field valid - works only first time
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP4
Database:
Oracle
Miscellaneous
Thread ID:
01087131
Message ID:
01087131
Views:
59
Hi,
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 ?)
Next
Reply
Map
View

Click here to load this message in the networking platform