To access these two options from the user interface, on the
Tools menu, click
Options, and then click the
General tab. In the
Use four-digit year formatting area, the
This database check box controls the database-level option and the
All databases check box controls the application-level option.
If either of these options is set, Access overrides the specified date format to show a four-digit year. The year portion of the date is the only part affected. Other parts of the date still rely on the Windows Regional Settings and Date formats.
The database-level option is stored in the Microsoft Access database (MDB) or Microsoft Access project (ADP). This allows developers to deliver year 2000-compliant applications regardless of the user's Regional Settings.
The application-level option is stored in the Windows Registry with all the other Access settings. This allows administrators to force all Access applications on the computer to use four-digit years, regardless of the Regional Settings, Date formats, or the database-level option.
You can programmatically check or set these options with the
GetOption and
SetOption methods respectively.
Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.
Use the following segment of code to determine the current database-level setting:
If GetOption("Four-Digit Year Formatting") = True Then
MsgBox "This database is using four-digit year formatting."
Else
MsgBox "This database is not using four-digit year formatting."
End If
The following segment of code forces Access to use four-digit year formatting at the database-level:
SetOption "Four-Digit Year Formatting", True
The following segment of code determines the current application-level setting:
If GetOption("Four-Digit Year Formatting All Databases") = True Then
MsgBox "Access is using four-digit year formatting."
Else
MsgBox "Access is not using four-digit year formatting."
End If
The following segment of code forces Access to use four-digit year formatting at the application-level:
SetOption "Four-Digit Year Formatting All Databases", True
For additional information about dates in Access, please see the following
article in the Microsoft Knowledge Base:
208339�
ACC2000: Years 00-29 Default to Year 2000 When Typed as M/D/YY