Example Apps for Businesses, Schools & Developers

Version 1.77         Approx 1 MB (zipped) First Published 26 May 2026



The built-in Access date picker has many issues including:

a)   the date picker icon only becomes visible after clicking in a bound date textbox - one extra & often unnecessary click
b)   months/years can only be changed one month at a time - painfully slow to do if you need to enter e.g. a date of birth
c)   it takes at least 3 clicks to select a date - click the textbox to make the icon visible; click the icon to open the control then click again to select a date
d)   the control doesn't appear for unbound textbox controls (unless these are formatted as dates)
e)   the control cannot be moved on the screen
f)   the control is quite small - particularly for anyone with eyesight issues

My Better Date Picker was created several years ago to overcome the above limitations of the Access date picker. Later versions of the utility added significant additional functionality including:

a)   First day of week automatically assigned according to Windows settings
b)   Date format automatically assigned according to Windows regional settings
c)   Day and month names are displayed using the regional language currently in use
d)   Out-of-month days added in dark grey (optional)
e)   Days from following month only shown if in same week as last day of current month
f)   Selecting an out of month day assigns the correct month automatically. Also works successfully for dates selected in previous year or following year
g)   Clicking the Today button resets the calendar to the current month/year & highlights current date ready for selection to confirm
h)   Automatic form resizing added as an option to modify the font size according to screen resolution
i)   Week numbers as a separate column (optional)
j)   Option to modify all form captions to the current Office language

However, until now it wasn't possible for developers / end users to customise the date picker by marking localised public holidays or custom events on the calendar.
Following a request in this lengthy thread Three new Access Roadmap features at Access World Forums, both features have been enabled in this latest version.



Version 1.77 - 18 May 2026

In this version, users can include public holidays and events in the date picker form as shown in this short (25s) video:




Key:
Blue background = public holiday
Pale orange background = user defined event
Yellow background = selected date
Green background = today

Holidays & Events Control Tip Text
Each displays control-tip text on mouse hover over a highlighted date e.g. 25 May = Spring Bank Holiday.

Holidays & Events Control Tip Text - English
All items on the form are translated into the language used by Windows or Access.

Holidays & Events Control Tip Text - Spanish
A separate form, frmBDPCalendar, is used to enter / edit this data which is stored in a user-defined system table, USysCalendar, together with the control tip text for each item.

BDP Calendar Events Form
Following a request in the forum thread, I added the option to display a date picker button as an icon instead of directly opening the date picker itself.

Date Picker Button Icon
Showing the icon means users can directly enter the date in the textbox and bypass the date picker if preferred.



Code Changes

This new version is based on v1.72 but with the following code changes:

a)   Additional colours defined in the declaration section of modDatePicker

'colour definitions: Colin Riddington
Public Const ColOrange = 10079487
Public Const ColPaleYellow = 10092543
'Public Const ColBlue = 6697728
Public Const ColPaleBlue = 14922894
Public Const ColDarkBlue = 8388608
'Public Const ColBorder = 4210752
Public Const ColLemon = 10092543
Public Const ColDarkRed = 128
Public Const ColMidRed = 1643706
Public Const ColPaleGreen = 13434828
Public Const ColDarkGreen = 32768
Public Const ColPaleGrey = 14869218
Public Const ColDarkGrey = 9868950
'Public Const ColMidGrey = 11842740


b)   Moved the code to start the date picker and process the output into a new procedure SetDatePicker (in the calling form)

Private Sub SetDatePicker()

Dim strText As String

If GetInternetConnectedState = -1 And GetCurrentOfficeLangCode <> "en" Then
strText = TranslateXL("Select a date to use this on your form", "en", GetCurrentOfficeLangCode())
DoEvents
InputDateField txtDate, strText
Else
InputDateField txtDate, "Select a date to use this on your form"
End If

DoEvents

'v1.6 - disable next line if week number not needed on this form
ShowWeekNumber

cmdExit.SetFocus
cmdDatePicker.Visible = False

End Sub


c)   Added MouseMove events for all 42 date buttons on frmDatePicker - used to set focus to the button without clicking it, so the control tip text is displayed. For example:

'v1.77 - Mouse Move events to set focus on each date button so control tip text is displayed
Private Sub d00_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
d00.SetFocus
End Sub

Private Sub d01_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
d01.SetFocus
End Sub

Private Sub d02_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
d02.SetFocus
End Sub

Private Sub d03_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
d03.SetFocus
End Sub


d)   Added code to the DrawDateButtons procedure to format each of the highlighted dates and display the control tip text on mouseover

' This method draws the date buttons on the 7 x 6 grid.
Private Sub DrawDateButtons()

'On Error GoTo Err_Handler

Dim MonthDayOne As Date, MonthDayLast As Date, MonthLength As Integer, DayOfWeek As Integer
Dim I As Integer, Y As Integer, X As Integer, btn As CommandButton

Dim OutOfCurrentMonth As Boolean
Dim OutOfDate As Date
Dim intMaxWeek As Integer

Dim strLang As String
strLang = GetCurrentOfficeLangCode()

' first day of this month:
MonthDayOne = DateSerial(myYear, myMonth, 1)
' day of week on which the first of the month falls:
DayOfWeek = DatePart("w", MonthDayOne, vbUseSystemDayOfWeek)
' length of this month:
MonthLength = DatePart("d", DateAdd("d", -1, DateAdd("m", 1, MonthDayOne)))

' Initialize i to be what day of the month button (0, 0) will be on.
'If the first of the month is Sun, start with i = 1.
' If the first of the month is Mon or Tue, start with i = 0 or
' i = -1, respectively.

' y and x count the current row and column where we are on the grid.

Set cmdCurrentDay = Nothing

'set visibility of day buttons
'all current month visible + days from previous / following month in same weeks
I = 2 - DayOfWeek
For Y = 0 To 5
For X = 0 To 6
Set btn = Me.Controls("d" & Y & X)
btn.ControlTipText = ""
btn.Visible = True
' If i falls within legal days for this month, show this button.
If (I > 0) And (I <= MonthLength) Then
OutOfCurrentMonth = False
btn.Caption = I
btn.Tag = I

'get row value for final day of selected month
If I = MonthLength Then intMaxWeek = Y
Else
'enable next line if out of month dates not required
' btn.visible = False

'code to enable dates from previous or following month
'disable if feature not required
'adapted from code suggested by Kitayama at Access World Forums
OutOfCurrentMonth = True
OutOfDate = DateAdd("d", I - 1, DateSerial(Year(myDate), Month(myDate), 1))
btn.Caption = Day(OutOfDate)
btn.Tag = btn.Caption
If I > MonthLength And Y > intMaxWeek Then btn.Visible = False
End If

'==================================================
'v1.77 - UPDATED CODE to handle holidays / events and control tip text
'format day colour
If I = Day(Date) And txtYear = Year(Date) And cboMonth = Month(Date) Then 'today
btn.ControlTipText = "Today's Date"
btn.BackColor = ColDarkGreen
btn.ForeColor = vbWhite
btn.FontWeight = 600
btn.ControlTipText = Space(2) & TranslateXL("Today's Date", "en", strLang) & Space(2)
ElseIf I = SelectedDay And txtYear = SelectedYear And cboMonth = SelectedMonth Then 'selected date
Set cmdCurrentDay = btn
btn.BackColor = ColLemon
btn.ForeColor = ColDarkRed
btn.FontWeight = 600
' btn.FontSize = intFontSize + 2
btn.ControlTipText = Space(2) & TranslateXL("Selected Date", "en", strLang) & Space(2)
ElseIf X = 6 Then 'Sunday
btn.ForeColor = ColMidRed
ElseIf DCount("*", "qryCalMonthYear", "ItemType = 'Holiday' And CalDay =" & I) > 0 Then 'holiday date v1.77
btn.BackColor = ColPaleBlue
btn.ForeColor = vbWhite
btn.FontWeight = 600
btn.ControlTipText = Space(2) & DLookup("TipText", "qryCalMonthYear", "ItemType = 'Holiday' And CalDay = " & I) & Space(2)
ElseIf DCount("*", "qryCalMonthYear", "ItemType = 'Event' And CalDay =" & I) > 0 Then 'event date v1.77
btn.BackColor = ColOrange
btn.ForeColor = ColDarkBlue
btn.FontWeight = 600
btn.ControlTipText = Space(2) & DLookup("TipText", "qryCalMonthYear", "ItemType = 'Event' And CalDay =" & I) & Space(2)
Else 'other dates
btn.BackColor = ColPaleGrey
'currently selected month in blue
btn.ForeColor = ColDarkBlue
btn.FontWeight = 400
btn.FontSize = intFontSize
' btn.ControlTipText = "Click to select date"
'previous/following month in dark grey
'disable if out of month dates not required
If OutOfCurrentMonth Then btn.ForeColor = ColDarkGrey
End If
'==================================================

' Advance to next day.
I = I + 1
Next
Next

Exit_Handler:
Exit Sub

Err_Handler:
MsgBox "Error " & Err.Number & " in DrawDateButtons procedure : " & Err.Description
Resume Exit_Handler

End Sub




Using the Better Date Picker in your own apps

If you want to use ALL the available features, import ALL objects except frmMain into your own database.

Tables:   tblMsoLang / USysCalendar
Query:   qryCalMonthYear
Macro:  Autoexec
Forms:   frmDatePicker, frmBDPCalendar
Modules:   modDatePicker, modLocale, modResizeForm, modTranslate

NOTE:
The USysCalendar table is a user defined system table and is normally hidden in the navigation pane. Tick Show System Tables in Navigation Options to make this table visible.


Customising the Better Date Picker

By default, clicking on a date textbox opens the date picker using the SetDatePicker procedure.

If you prefer to show the date picker icon next to the date textbox on your calling form, modify the code as shown below:

Private Sub cmdDatePicker_Click()

'Following code only used if button set visible when txtDate is clicked
' SetDatePicker

End Sub

Private Sub txtDate_Click()

'v1.77 OPTIONAL - show date picker icon when clicked
' cmdDatePicker.Visible = True

'If previous line enabled, comment out line below and enable same code in cmdDatePicker_Click event
SetDatePicker

End Sub


If you do not need certain features, make the following changes:

a)   Remove Week Numbers
      Disable the line ShowWeekNumber in the SetDatePicker procedure

b)   Remove Automatic Form Resizing
      Disable or delete the line ResizeForm Me in the Form_Load event of frmDatePicker and do not import module modResizeForm

c)   Remove Translation features
      If you only need English captions, use version 1.77_En instead. All translation related code and objects have been removed from this version.



Downloads

Click to download:
            Better Date Picker v1.77         ACCDB file   Approx 1 MB (zipped)     INCLUDES translation code

            Better Date Picker v1.77 En    ACCDB file   Approx 1 MB (zipped)     English ONLY - no translation code

As is the case for all files downloaded from the internet, first unblock the downloaded file, unzip then save to a trusted location.
For more details, see my article: Unblock downloaded files by removing the Mark of the Web



Feedback

Please use the E-Mail button in the contact form below to let me know whether you found this article useful or if you have any questions.

Please also consider making a donation towards the costs of maintaining this website. Thank you.


Colin Riddington Mendip Data Systems Last Updated 26 May 2026




Return to Example Databases Page




Return to Top