kadrleyn
Member
A useful template about data selection & entry using option buttons on the userform , quick date entry into selected textboxes with a calendar form (Trevor Eyre's calendar form- https://chandoo.org/forum/threads/fully-customizable-vba-date-picker.19508/ ) that it is alternative to date picker.
When double-clicked on the textbox, the calendar form is displayed. The selected date is added to the text boxes in "mm/dd/yyyy" format.
![77011 77011](https://chandoo.org/forum/data/attachments/77/77103-8b6029b2d4c6d6d8e93042d5edf6d0ea.jpg)
Source
When double-clicked on the textbox, the calendar form is displayed. The selected date is added to the text boxes in "mm/dd/yyyy" format.
![77011 77011](https://chandoo.org/forum/data/attachments/77/77103-8b6029b2d4c6d6d8e93042d5edf6d0ea.jpg)
Code:
Private Sub txtDOTDate_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
Call GetCalendar
End Sub
Sub GetCalendar()
dateVariable = CalendarForm.GetDate(DateFontSize:=11, _
BackgroundColor:=RGB(242, 248, 238), _
HeaderColor:=RGB(84, 130, 53), _
HeaderFontColor:=RGB(255, 255, 255), _
SubHeaderColor:=RGB(226, 239, 218), _
SubHeaderFontColor:=RGB(55, 86, 35), _
DateColor:=RGB(242, 248, 238), _
DateFontColor:=RGB(55, 86, 35), _
TrailingMonthFontColor:=RGB(106, 163, 67), _
DateHoverColor:=RGB(198, 224, 180), _
DateSelectedColor:=RGB(169, 208, 142), _
TodayFontColor:=RGB(255, 0, 0))
If dateVariable <> 0 Then frmflightstats.txtDOTDate = dateVariable
frmflightstats.Frame3.SetFocus
End Sub
Source