Information générale
Catégorie:
Codage, syntaxe et commandes
>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
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