I would like the calendar to work as follows (in an unbound form in order to use date for queries):
1) Click empty combo box cboStartDate to bring up calendar
2) Calendar opens to current month
3) User can click on calendar to select date
4) The date selected in the calendar is entered in cboStartDate
5) The calendar hides again
I used this code in another form and it worked perfectly, I don't know what the difference is, but for some reason this time it never changes dates. No matter what date I select on the calendar, 3/5/2008 is entered in cboStartDate
Thanks Guys!
1) Click empty combo box cboStartDate to bring up calendar
2) Calendar opens to current month
3) User can click on calendar to select date
4) The date selected in the calendar is entered in cboStartDate
5) The calendar hides again
I used this code in another form and it worked perfectly, I don't know what the difference is, but for some reason this time it never changes dates. No matter what date I select on the calendar, 3/5/2008 is entered in cboStartDate
Code:
Private Sub cboStartDate_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
ocxCalendar.Visible = True
ocxCalendar.SetFocus
If Not IsNull(cboStartDate) Then
ocxCalendar.Value = cboStartDate.Value
Else
ocxCalendar.Value = Date
End If
End Sub
Private Sub ocxCalendar_Click()
cboStartDate.Value = ocxCalendar.Value
cboStartDate.SetFocus
ocxCalendar.Visible = False
End Sub
Thanks Guys!