Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Date like MM/YYYY
Message
 
To
14/08/2006 05:09:08
Mk Sharma
Shrishti Solutions
Mumbai, India
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01145224
Message ID:
01145235
Views:
23
>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.
Previous
Reply
Map
View

Click here to load this message in the networking platform