DateTime picker control, problematic behavior
-
22-09-2019 - |
Question
A datetime control on a form, bound to a table field, works fine.
If I add the picker inside a tab control it raises this error when I load the form:
An error occured in a call to the Windows Date and Timer Picker control.
Is any workaround for this problem?
Solution
if you are initializing the value of the DTPicker and it's not visible you'll get that error:
// a shortcut to get it visible if it's not in the selected tab:
DTPicker.SetFocus
DTPicker.Value = Now
OTHER TIPS
See the Calendar Tips page at my website
There could, likely will, be lots of version problems when you go to distribute the MSCal.OCX..
One alternative is MonthCalendar is a completely API generated Month Calendar derived directly from the Common Control DLL. There are links to several downloadable calendar forms at my website. As these are forms you can also do anything with them you want.
You can also use the calendar form which comes in the Access Developers Handbook by Litwin/Getz/Gilbert, publisher Sybex www.developershandbook.com. These books are well worth spending money. Every time I open one I save the price of the book.