Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Textbox with Control Source Problem ??
Message
 
À
27/01/2005 22:53:57
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows '98
Network:
SAMBA Server
Database:
Visual FoxPro
Divers
Thread ID:
00981597
Message ID:
00981805
Vues:
33
Leo Here how I resolve this problem:
In GotFocus event of the TextBox:
** GotFocus
thisform.old_value = this.Value

** In Valid Event
LOCAL ret_val, m_rec
ret_val = .t.
IF LastKey() # 27 && if the user press Esc
   IF thisform.old_value # this.Value
      SELECT MyTable
      old_record = RecNo()
      SEEK this.Value  && To Move the pointer
      GOTO old_record
   ENDIF  
ENDIF
RETURN ret_val

*** In Error event of the TextBox
  LPARAMETERS nError, cMethod, nLine
  IF nError = 1884 && Uniqueness is violated
     MessageBox("Record with this value already exiists",0,"Warning")
     this.Value = thisform.old_value
  ENDIF
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform