Example Apps for Businesses, Schools & Developers

A Better Date Picker  

Click the image to view a larger version

Version 1.4             Updated 8 June 2022               Approx 600 kB (zipped)

The built in Access date picker control works in both 32-bit & 64-bit Access.
It was first introduced with Access 2010 to replace the old ActiveX calendar control which was 32-bit only.

AccessDatePicker
Although it does work, there are some issues:
a)   the date picker icon only becomes visible after clicking in a bound date textbox - one extra 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

The Better Date Picker is designed to improve on the poor functionality of the built-in date picker
It is a replacement date picker with no Active X controls. It can be used in both 32-bit and 64-bit Access.

The original version of this utility was originally posted in this thread at Access World Forums in Jan 2018

The calendar form was loosely based on open source code by Brendan Kidwell from 2003 which can be found at: http://www.glump.net/content/accessdatepicker/

However, I've since made extensive changes to both the appearance and functionality of the calendar form.

If all you want is a visual calendar, it will certainly do that. However, its main purpose is to input a date in a form textbox.

DatePicker

All you need for that is one line of code in the textbox click event:

CODE:


  Private Sub txtDate_Click()
     InputDateField txtDate, "Select a date to use this on your form"   'Modify text as required
  End Sub



The string "Select a date to use this on your form" is used for info on the form and can be adapted to suit.

To use, copy frmDatePicker and modDatePicker to your own application.
Ignore frmMain - its only needed for the example app



Version History

v1.0   30 Jan 2018
          Original release. Days displayed in English from Sun to Sat

DatePickerForm


v1.1   UPDATE - 3 Jan 2022
          Following a request at Utter Access forum, I created an alternative version with the calendar display week starting on Mondays and ending on Sundays.

DatePickerFormM2S

v1.4   UPDATE - 7 June 2022
          Significant changes made following suggestions made by @Kitayama at Access World Forums
          a)   First day of week now automatically assigned according to Windows settings - no need for multiple versions
          b)   Date format automatically assigned according to Windows regional settings
                For example: dd/mm/yyyy (UK); mm/dd/yyyy (USA); dd.mm.yyyy (Germany); d/m/yyyy (Greece); yyyy/mm/dd (Japan)
          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

        Below are 2 examples in Japanese and Greek with different date formats and day order

Japanese: Sun to Sat - date format yyyy/mm/dd

Better Date Picker Japanese: Sun-Sat

Greek: Mon to Sun - date format d/m/yyyy

Better Date Picker Greek: Mon-Sun



      Click to download:       Better Date Picker v1.4     (zipped)



Video

      I have created a short video comparing the functionality of the built-in Access date picker control with my better date picker.
      You can watch the Better Date Picker video on my YouTube channel or you can click below:

       

      If you liked the video, please subscribe to my Isladogs on Access channel on YouTube. Thanks.



      Colin Riddington                       Mendip Data Systems                       Last Updated 8 Jun 2022



Return to Example Databases Page




Return to Top