Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Date like MM/YYYY
Message
 
À
14/08/2006 05:09:08
Mk Sharma
Shrishti Solutions
Mumbai, Inde
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01145224
Message ID:
01145235
Vues:
21
>some times user make mistake in feeding,
>
>instead of 08/2006 they feed like 8/06, if i store the value in a text box.
>
>warm regards,
>mk.

You could do something like that (in your validation routine):
LOCAL ldDate, lcOldDateFormat, lcOldCentury, lbRetVal
m.lcOldDateFormat = SET([DATE])
m.lcOldCentury    = SET([CENTURY])
SET DATE BRITISH
SET CENTURY ON
ldDate = CTOD([01/]+thisform.TextBoxName.Value)
IF NOT EMPTY(ldDate) && Correct date entered
   thisform.TextBoxName.Value = RIGHT(DTOC(ldDate),7) && To Expand TextBox value to full month and year
   m.lbRetVal = .t.
ENDIF
SET DATE &lcOldDateFormat
SET CENTURY &lcOldCentury
RETURN m.lbRetVal
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform