Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Exiting a Textbox Validation
Message
De
23/03/1999 11:59:01
 
 
À
23/03/1999 11:43:02
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00200980
Message ID:
00200992
Vues:
8
>I have a VFP 5 form with a few textboxes that I would
>like to validate. For instance, the deposit date can
>not be greater than the payment date.
>
>However, I would also like the user to be able to exit
>the entry via an escape key. The code below is my
>attempt.
>
>IF LASTKEY() = 27
> ThisForm.cmdCancel.Click()
> RETURN 1 && this does not work
>ELSE
> IF This.Value > This.Parent.txtdpayment.value
> MessageBox('Deposit date > Payment date',0)
> RETURN 0
> ENDIF
>ENDIF
>
>If I hit the escape key the textbox still has focus and
>when I attempt to move off it the valid fires. This is
>somewhat of a recursive issue.
>
>Can someone help. I am sure that many of you have been down
>this path...

You may try to use 'Cancel' button: button.cancel=.T. It should circumvent Valid codes.
Edward Pikman
Independent Consultant
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform