Calendar Control Default to Current Date?

J

JS

I have a calendar control on my form that seems to be
working well. However, when I add a new record the
default date on the calendar is the date I created it
rather than the current date. How do I show the current
date? Would appreciate any suggestions.

Here's my code:

Private Sub cboDate_MouseDown(Button As Integer, Shift As
Integer, X As Single, Y As Single)
With Calendar1
.Visible = Not .Visible
If .Visible Then
.SetFocus
.Value = Date
Else
cboDate.SetFocus
End If
End With
End Sub
__________________________________________

Private Sub Calendar1_Click()
With Calendar1
cboDate.Value = .Value
cboDate.SetFocus
.Visible = False
End With
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top