default to date() in Calendar

hanusborb

New member
Local time
Today, 08:38
Joined
Dec 1, 2009
Messages
2
Hey all,

I'm using the calendar that is stock in access2003. here is the code i've used to get it to pop up.

Private Sub Text25_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Set cboOriginator = Text25
ocxCalendar2.Visible = True
ocxCalendar2.SetFocus

If Not IsNull(cboStartDate) Then
ocxCalendar2.Value = cboOriginator.Value
Else
ocxCalendar2.Value = date
End If

End Sub

Private Sub ocxCalendar2_Click()
cboOriginator.Value = ocxCalendar2.Value
cboOriginator.SetFocus
ocxCalendar2.Visible = False
Set cboOriginator = Nothing
End Sub

Pretty standard and it works good.

does anyone know how i can get it to default to todays date when i click the combobox to display it? it would be a much sweeter calendar if it would.

thank you very much
Cheers
 
I think you need to use Date() instead of date in
ocxCalendar2.Value = date
 

Users who are viewing this thread

Back
Top Bottom