Activex Calendar code

J

Jorge Meneses

I have a subform that has a date field. I added an
activex calendar to the subform, but I thought it will
appear in my form automatically, which is not the case.
What code can I write to say for example: when user enters
or clicks date field, make calendar available to user.
Thanks for any help.
 
J

Jeff Conrad

Hi Jorge,

Lots of options for you for calendars.

You can use the Calendar ActiveX Control that ships with
your Access program. You'll find it under your ActiveX
Controls list.

To help you see how this works I suggest you go to Arvin
Meyer's site and download a couple of his sample databases
that demonstrate how to use the calendar.

http://www.datastrat.com/Download2.html

You may also want to check Tony Toews' site which lists
many calendar options including using forms and even an
API solution. You can find that here:

http://www.granite.ab.ca/access/calendars.htm

This is my personal favorite from Sensei Stephen Lebans:
I HIGHLY RECOMMEND IT!!

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

Here is my person Top 10 list for calendars:
1. http://www.lebans.com/monthcalendar.htm
http://www.lebans.com/monthcalendar.htm
http://www.lebans.com/monthcalendar.htm
http://www.lebans.com/monthcalendar.htm
http://www.lebans.com/monthcalendar.htm
http://www.lebans.com/monthcalendar.htm
http://www.lebans.com/monthcalendar.htm
http://www.lebans.com/monthcalendar.htm
http://www.lebans.com/monthcalendar.htm
http://www.lebans.com/monthcalendar.htm

If you need step-by-step instructions on how to use it in
your database post back and I'll help.
 
J

Jeff Conrad

Ok, how about I press Send a few more times before I'm ready??
(One of the keyboard keys is actually sticking here!)

Stephen's calendar has the advantage of being a completely API driven calendar so you don't have to
worry about versioning issues with Active X controls. Once you use it, you will be very pleased with
the results.

There are step-by-step instructions on how to use the calendar on his site.
I forgot one little step though.
Think of this as Step 9.5:

If you want to call the calendar, but not have the ability to select a range of dates insert one
line of code to limit the selection of dates to just one. Like so:

Private Sub txtSelectDate_DblClick(Cancel As Integer)

Dim blRet As Boolean
Dim dtStart As Date, dtEnd As Date

mc.MaxSelectRangeofDays = 1

dtStart = Nz(Me.txtSelectDate.Value, 0)
dtEnd = 0

blRet = ShowMonthCalendar(mc, dtStart, dtEnd)
If blRet = True Then
Me.txtSelectDate = dtStart
Else
' Add any message here if you want to
' inform the user that no date was selected
End If

End Sub

(Incidentally, I'm earning frequent flyer miles by mentioning his calendar. I'm saving up to visit
Fred in Canada. So far I've accumulated enough points for a seat on the wing of a crop duster from
here to Burns. Still have a ways to go.)
 
J

Jorge Meneses

Thanks a lot for your information. I will be checking the
websites you gave me. Thanks a million again.

Jorge
-----Original Message-----
Ok, how about I press Send a few more times before I'm ready??
(One of the keyboard keys is actually sticking here!)

Stephen's calendar has the advantage of being a
completely API driven calendar so you don't have to
worry about versioning issues with Active X controls.
Once you use it, you will be very pleased with
the results.

There are step-by-step instructions on how to use the calendar on his site.
I forgot one little step though.
Think of this as Step 9.5:

If you want to call the calendar, but not have the
ability to select a range of dates insert one
line of code to limit the selection of dates to just one. Like so:

Private Sub txtSelectDate_DblClick(Cancel As Integer)

Dim blRet As Boolean
Dim dtStart As Date, dtEnd As Date

mc.MaxSelectRangeofDays = 1

dtStart = Nz(Me.txtSelectDate.Value, 0)
dtEnd = 0

blRet = ShowMonthCalendar(mc, dtStart, dtEnd)
If blRet = True Then
Me.txtSelectDate = dtStart
Else
' Add any message here if you want to
' inform the user that no date was selected
End If

End Sub

(Incidentally, I'm earning frequent flyer miles by
mentioning his calendar. I'm saving up to visit
Fred in Canada. So far I've accumulated enough points for
a seat on the wing of a crop duster from
 

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