Databases - Calendars and Dates
Calendars and Dates - how trivial ... all applications seem to use these.
Too bad they're so difficult to figure out.
It appears that Microsoft XP provides 2 controls via its Common Controls
Library - C:\WIN98\SYSTEM\MSComCt2.OCX -
DateTimePicker and MonthCalendar.
That file missing in Windows Vista.
MS Access 2007
Starting with MS Access 2007, the date/calendar functionality is built in and
there is no longer a need for a separate ActiveX component.
When the user clicks inside the text box, a calendar icon will be displayed
to the right of the text field. When the icon is clicked, the calendar will be displayed.
- Place a text box on the form
- Format it to display dates
- Enable the display of the Date picker
MS Access 97
There are 3 calendar controls.
They can be added to a form via either of 2 methods
The following lists the controls (and their libraries) to select from the list.
- In the Toolbox, click the More Controls icon
and select the control from the list. The associated filenames
are not listed.
- From the menu, select Insert / ActiveX Control....
This list is easier to use and the associated filenames are listed
... except for controls implemented via COMCTL32.DLL
(and perhaps a few others).
- MonthView - places a single month on the form
- Select - Microsoft MonthView Control
- DTPicker - a ComboBox Calendar control
- Select - Microsoft Date and Time Picker Control, Version x.x
- Calendar - another single month calendar
- Select - Calendar Control x.x
Though the default parameters are obviously different,
MonthView and DTPicker controls appear to be identical to the Delphi
TMonthCalendar and TDateTimePicker respectively.
Of course, nothing is quite as simple as this,
I suggest that you read my
MS Access - Calendar Example
before trying to do this on your own.
On the Win32 tab, Delphi 5 provides
Apparently, these functions are implemented via the Windows Common Controls
a few calendar type functions are implemented via Kernel 32.
- This attaches a calendar to a combo box -
just click the down arrow to see the calendar.
- This displays a calendar on the form.
In order for the user to set both the date and time requires 2
DateTimePicker's. On one of them, set the kind property
to dtkTime (the default is dtkDate).
dt : string;
dt := DateToStr(DateTimePicker1.Date) + ' ' + TimeToStr(DateTimePicker2.Time);
Author: Robert Clemenzi -