Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to control the date validation for the TextBox?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00221016
Message ID:
00221063
Vues:
26
One way I found would be to:
- Unbound the textbox from the date field
- Format = "R"
- InputMask = "9999/99/99"
- Valid():
IF NOT Empty(THIS.Value) AND;
      Empty(CToD(Left(THIS.Value, 4) + "/" + SubStr(THIS.Value, 5, 2) + "/" + Right(THIS.Value, 2)))
   WAIT WINDOW "The date is invalid"
   RETURN .F.
ELSE
   REPLACE MyDateField WITH THIS.Value
ENDIF
There still room for improvements, because of the hard coded date format, but it's a start.

>If you drop a textbox on a for with the value property set to =date() you have a txtbox field that will check for a valid date. If you input a invalid date VFP will display a wait window with "Invalid Date".
>
>How can I change the messages displayed for a different Messages?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform