Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Force a 4 Digit Year
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00213242
Message ID:
00213252
Vues:
26
>How do I force a user to enter a 4 digit year. I have looked at SET CENTURY TO n ROLLOVER n command and have created a table with a date field. But the user can still enter a 2 digit year and then the SET CENT command comes into effect.
>
>I want to FORCE the user to enter 4 digits as the year!
>
>This has to be in code as OCX's are not stable enough in VFP for me.
>
>Thanks
>Bernard

Use the .Keypress event to count keystrokes and make sure user has entered 8.
This also means that you'd have to blank out the date when a user first makes a change. Sure, you can leave a previous value there, but once they start typing in a date field, blank out and start counting. This will force the user to input the entire date. Sounds tough on the user but if those who are paying the bills are demanding full dates, they'll probably like it.

Steve
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform