Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Valid Event in a TextBox
Message
De
22/01/1999 12:30:58
 
 
À
22/01/1999 12:16:21
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00179019
Message ID:
00179033
Vues:
29
Is SET EXACT ON? If not, maybe it did find a matching record (ex: Tommy = Tom yield True).

I would suggest a different route: since this field must be unique, create a candidate index on ID_No. After that, you just need to trap the result from TableUpdate().

HTH

>I simply want to check if an id number entered in a TextBox exists in the table. The id is attached to the physical document but should not be duplicated, therefore I would like to check it against the existing table. The Valid Event seem like the logical choice. I have the following code in the Valid Event:
>
>lcID = alltrim(this.value)
>
>locate for alltrim(drawing.id_no) = lcID
>if found()
> =MessageBox(lcID)+' already exists!')
> return .f.
>else
> return .t.
>endif
>
>For some reason that's beyond me (at least at the moment) it won't tab off if the id doesn't exist in the table, in fact it's pretty difficult to get it out of the TextBox once entered. The same basic process works in a grid on the same form. What am I missing?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform