Provided by Allen Browne, October 2004. Updated April 2010.
There are plenty of ActiveX control calendars, but they have issues with versioning, broken references, and handling Nulls. This is an ordinary Access form you can import into any database.
Download the zip file (30 KB) for Access 2000 and later or Access 97.
In Access 2007 and laber, there's a popup calendar built in, so this form is not needed (though it does work.) Just set the Show Date Picker property of the text box to "For dates."
To use the calendar:
When you click the button, it pops up the calendar, reading the date from your text box. Select a date and click Ok, or double-click a date to write it back to your text box and close the calendar. Click Cancel to close the calendar without changing the date.
The command button that opens the calendar is tied to a particular text box, so there is no problem with adding multiple command buttons and reusing the popup calendar if your form needs several dates.
Keyboard shortcuts | |
Left | prior day |
Right | next day |
Up | prior week |
Down | next week |
Home | first of month |
End | last of month |
Pg Up | prior month |
Pg Dn | next month |
There are no restrictions on how you use this calendar. You may freely use it in any database you develop, for personal or commercial purposes.
Pause the mouse over the question mark to see the list of keyboard shortcuts. Alt+T is the hotkey for today's date.
A "Type Mismatch" message (Error 13) will occur if your text box contains a non-date value. To avoid this:
As supplied, the calendar works only with text boxes, not combos.
For other alternatives, Stephen Lebans has a wrapper class for the Microsoft Month Calendar Common Control. Tony Toews and Jeff Conrad list other options.
Home | Index of tips | Top |