Information générale
Titre:
Exiting a Textbox Validation
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...
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement