|
-
Aug 13th, 2011, 11:33 AM
#1
Thread Starter
Lively Member
[RESOLVED] Calendar control active day
Hi.... I'm using a calendar control and, if I click on an incorrect date, I want to put the focus back onto the date that was active before I clicked on the incorrect date. And I thought this would work...
Code:
calendarnumber = 1
mycalendar.value = calendarnumber
But it doesn't. So any help would be appreciated (I know about the monthview control but I just want to stick with this type of calendar for now).
-
Aug 13th, 2011, 03:50 PM
#2
Re: Calendar control active day
What, in the context of what you're trying to do, is an 'incorrect date'?
-
Aug 13th, 2011, 05:06 PM
#3
Re: Calendar control active day
Doesn't matter. MSCAL.OCX is part of Office and you can't redistribute it. It also isn't approved for use in VB6, VFP6, etc. programs much like the MS Forms 2.0 library.
-
Aug 13th, 2011, 08:02 PM
#4
Re: Calendar control active day
try something like this
Code:
Dim PreDay As Date
Private Sub Form_Load()
PreDay = 12
Calendar1.Day = PreDay
End Sub
Private Sub Calendar1_Click()
Calendar1.Day = PreDay
End Sub
-
Aug 14th, 2011, 01:17 AM
#5
Thread Starter
Lively Member
Re: Calendar control active day
seenu_1st, I tried your code and it helped, thanks.
Doogle, an incorrect date is a date that isn't within a particular range. In my program the range is from the first day of the current month up to and including the current day of the current month.
I forgot to mention in my first post that I'm only trying to work with the current month's dates (my bad.) So really my question is, how do I put the focus back onto the previously active date in the current month, after I click on an incorrect date that is outside my range?
-
Sep 10th, 2011, 09:51 AM
#6
Thread Starter
Lively Member
Re: Calendar control active day
After taking a break from this problem, I've decided to give it another go. So, does anyone out there have any suggestions? Thanks.
-
Sep 14th, 2011, 03:18 AM
#7
Thread Starter
Lively Member
Re: Calendar control active day
Got it. The problem was that I was storing the previously active day not the previously active date. So instead of using this....
Code:
calendarnumber = format(mycalendar.value, "d")
I simply should have been using....
Code:
calendarnumber = mycalendar.value
Problem solved.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|