PRB: Date in Text Box Displays Year With Four Digits (174426)
The information in this article applies to:
- Microsoft Visual FoxPro for Windows 5.0
- Microsoft Visual FoxPro for Windows 5.0a
This article was previously published under Q174426 SYMPTOMS
The dates in your text boxes display the year with four digits even with
the setting of SET CENTURY OFF.
CAUSE
This is by design and is necessary for year 2000 compliance.
RESOLUTION
To be year 2000 compliant you must display the year with four digits. If,
however, you want to have just the two-digit year to make data entry
easier, you can set the StrictDateEntry text box property to 0. With this
property set to 0, the date is loosely formatted and can take a space,
period, hyphen, and forward slash as separators. This also allows you to
leave off the year, and it assumes the current year.
Other hints to make data entry of dates easier are listed below:
- In Visual FoxPro 5.0 make sure that Set Century To <nCentury> Rollover <nYear> command is set properly. A recommended setting would be:
m.nYear = Year(Date())+ 50 && Set the rollover 50 years from today.
Set Century To (Int(m.nYear/100)-1) Rollover (m.nYear % 100)
- Use the plus and minus keys to increment and decrement a date in a text box. This only works if the entire field is selected, so you may want to set the text box property SelectOnEntry to .t.
STATUS
This behavior is by design.
REFERENCES
Visual FoxPro Help; search on: "StrictDateEntry"
(c) Microsoft Corporation 1997, All Rights Reserved. Contributions by David
Botzenhart, Microsoft Corporation
Modification Type: | Minor | Last Reviewed: | 2/24/2005 |
---|
Keywords: | kbnofix kbprb KB174426 |
---|
|