I decided to write a DatePicker replacement for the DateTimePicker control, since Microsoft no longer support it, the various solutions I found on the internet were nowhere near satisfying.
- Reference DatePicker.d.accde
- On a form, create a TextBox, with a Picture right next to it.
- From VBA, instanciate a DatePicker object by calling the createDatePicker function, it require a TextBox and a Picture control as arguments.
- Once you no longer need the instance, you must manually destroy it, by explicitly calling the Dispose method.
- The form must not be modal.
- Controls must be in the Detail section
- The DatePicker class take control of the textbox and picture provided as arguments, so avoid messing up with these.
- It also take control of the form's current event Handler, as well as the section Detail's mouseDown event Handler.
- The class only support choosing a date, nothing was done about time.
I provide 2 files:
- a Test database, wich is a usage sample.
- DatePicker.d.accde, a debug version, wich in case of error, will provide an error log in the execution window.