ActiveX controls (calendar control)

J

Jeff Gillette

How do you make a calendar display the current date? When I insert
the calendar control onto a form it displays the correct date but the
next day it still displays the date it was inserted.
Also how do you use the calendar to insert a date into a date field?
I have an appointment date field and would like to insert a date into
that field by pressing a date on the calendar.

Thanks,
talonfixer
 
J

Jeff Conrad

in message:
How do you make a calendar display the current date? When I insert
the calendar control onto a form it displays the correct date but the
next day it still displays the date it was inserted.

Put this code in the Form's Load event:

Private Sub Form_Load()
Me.NameOfMyCalendarControlHere.Today
End Sub

Replace with actual name of course.
Also how do you use the calendar to insert a date into a date field?
I have an appointment date field and would like to insert a date into
that field by pressing a date on the calendar.

Put this in the Click event of the calendar control:

Private Sub NameOfMyCalendarControlHere_Click()
Me.txtMyDateField = Me.NameOfMyCalendarControlHere.Value
End Sub

Replace with actual names of course.

You will need to go directly to the code window for the click event
since it does not show up on the Properties list of the Calendar Control.

Hey BTW, I just came across this sweeeet calendar today:

http://www.lebans.com/monthcalendar.htm

Take a look, this thing rocks and is way better than the ActiveX
Calendar Control!
 
Top