Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Calendar Control 8.0 question

Skip to first unread message

Robert Crandal

unread,
Nov 20, 2009, 3:56:47 PM11/20/09
to
Is it possible to restrict the date ranges of the Calendar
Control 8.0?? I only want the year 2009 to be selected
from the drop down box.

Thank you!


Mike Fogleman

unread,
Nov 21, 2009, 10:12:12 AM11/21/09
to
You can't change what is in the drop-down for years, but you can limit the
year to 2009 on the calendar even if they select another year from the
drop-down. Put the following code in the Worksheet code module that your
calendar is on.

Private Sub Calendar1_NewYear()
Calendar1.Year = 2009
End Sub


Mike F

"Robert Crandal" <nob...@gmail.com> wrote in message
news:loDNm.45264$de6....@newsfe21.iad...

Robert Crandal

unread,
Nov 21, 2009, 3:39:24 PM11/21/09
to
Thank you! That code works great. Just what I'm looking for!

"Mike Fogleman" <mikefo...@comcast.net> wrote in message
news:ec7GB0ra...@TK2MSFTNGP02.phx.gbl...

Robert Crandal

unread,
Nov 23, 2009, 2:51:05 AM11/23/09
to
Hi again Mike. I just had another follow-up question....

Do you know if I can limit the calendar to only a couple
years?? For example, what if I wanted to limit it
to 2009 AND 2010 AND 2011?? How would the
code look then??


"Mike Fogleman" <mikefo...@comcast.net> wrote in message
news:ec7GB0ra...@TK2MSFTNGP02.phx.gbl...
>

Mike Fogleman

unread,
Nov 23, 2009, 6:59:42 AM11/23/09
to
Private Sub Calendar1_AfterUpdate()
If Calendar1.Year > 2011 Then Calendar1.Year = 2011
If Calendar1.Year < 2009 Then Calendar1.Year = 2009
End Sub

Mike F


"Robert Crandal" <nob...@gmail.com> wrote in message

news:L9rOm.63909$gg6....@newsfe25.iad...

Robert Crandal

unread,
Nov 25, 2009, 5:07:22 AM11/25/09
to
Ugghhh..... Guess what Mike? I can't use Calendar Control 8.0 at
work. I can only use Microsoft Date & Time Picker 6.0.

Do you know how to do this same thing with MS DT Picker 6.0?
I tried the following code below, but it doesnt seem to work:

Private Sub DTPicker1_AfterUpdate()
If DTPicker1.Year > 2011 Then DTPicker1.Year = 2011
If DTPicker1.Year < 2009 Then DTPicker1.Year = 2009
End Sub

Maybe I forgot to initialize something??

Thanks sooooooo much for your help!

"Mike Fogleman" <mikefo...@comcast.net> wrote in message

news:uO2cxRDb...@TK2MSFTNGP05.phx.gbl...

Mike Fogleman

unread,
Nov 25, 2009, 7:04:37 AM11/25/09
to
Select the DTPicker, select Design mode, and in the property settings, set
the Max date & Min Date.

Mike F
"Robert Crandal" <nob...@gmail.com> wrote in message

news:wl7Pm.11192$cX4....@newsfe10.iad...

Robert Crandal

unread,
Nov 25, 2009, 4:41:11 PM11/25/09
to
Thanks for the awesome advice Mike!

"Mike Fogleman" <mikefo...@comcast.net> wrote in message

news:%23DyT2dc...@TK2MSFTNGP02.phx.gbl...

0 new messages