Re: VBA Calendar Control without Control
Quote from GopsHey Chuck....
...Can you please tell me how you fixed this latest problem. I have a choice of going back to Phil's calendar that you updated (calendar 10.2) or get the fix from you to add to the IWRK4depr's version that I am using now.
thanks
Gops
Basically i fixed the problem by nullifying the equation that told the calendar to jump to a month when clicking numbers....
Private Sub ChkDate()
'Cblundell changed below Greater/Less than signs. Original= "If Format(ThisButton, "m") - 1 <> CB_Mth......"
'NEW= "If Format(ThisButton, "m") - 1 = CB_Mth......" so that when selecting dates calendar didnt
'jump months when a day between 1 & 12 was selected (as you would select the 12/06/05 (in dd/mm/yy format)
'and it would swap to december as display month)
If Format(ThisButton, "m") - 1 = CB_Mth.ListIndex Then CB_Mth.ListIndex = Format(ThisButton, "m") - 1
' gh added next line
CB_Yr = Year(ThisButton)
End Sub
Display More
On the original calendar (Phil's v10) - when looking at a month you can see a little bit of the month before and a little bit of the month after the current month.... eg looking at February, could also see January 30 & 31 and March 1st - 12th. If you clicked on dates from other months it would swap to that month. (click on march 5th, and current month would swap to March)
When i hacked to get it to work for UK computers, it screwed up and saw any number 1 - 12 as a "change the month prompt" so i had to disable all "swapping of months" to stop it doing it. (Hope you followed)
You'll find the code I posted above, with-in the "Calendar 10.2" file.
If you or someone else can retain all original functionality, and make it work for UK computers that would be great.... then you can get rid of my cheap hacks. ; )
Any Q's please let me know.
Chuck