By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,658 Members | 1,519 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,658 IT Pros & Developers. It's quick & easy.

Lebans' calendar

P: n/a
I have a quick, probably easy, question about Lebans' calendar
program.

I have a form that allows a user to click on different technicians.
When this happens, Lebans' calendar comes up with various dates set to
bold based on the technician selected. However, when I close the
calendar and select a different technician, the bold dates carry over
from the previous technician selected.

I can't find a way to clear the bold days after the user closes (or
before he opens) the calendar without creating different calander
objects for each technician. I'm sure there is a way, but I just can't
seem to find it.

Any help would be greatly appreciated.

MW
Nov 12 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
The latest versions clear the DayState array by default. I've also added
some new features and cleaned up the code some more.
http://www.lebans.com/monthcalendar.htm
Version 9.8 April 05, 2004

Couple of UI Bug fixes. Both the Font and Color Dialog Windows were
appearing BEHIND the MonthCalendar window. If the user did not select a
Color, the returned Error value(-1) was being applied.

Version 9.6 April 01, 2004

Sorry, another (and the final) Major modification to the calling
function logic including calling Parameter order. Removed several
function params and made them persistent properties instead. Simplified
function call to only require 3 params. Added Menu Check marks for
current settings in Properties Menu. Added Menu to allow user to close
the Calendar Window.

Version 9.4 March 28, 2004

Major modification to the calling function logic including calling
Parameter order. Changed function to return Boolean FALSE and
"StartSelectedDate =0" if user did not select a date from the
MonthCalendar. The hWndForm param is no longer optional.

Version 9.2 January 26, 2003

Fixed issue with focus not returning to forms in Popup mode.

Version 9.1

Fixed DayState property so that it is actually useable now without
having to jump through hoops! Fixed Window positioning prop so Calendar
will now popup at the cursor location when the user clicks to open the
Calendar. Fixed(hopefully) issue of Access properly getting the focus
after the Calendar closes. Cleaned code up a bit more!!

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"Mason" <ma***@codemonkey.cc> wrote in message
news:eb**************************@posting.google.c om...
I have a quick, probably easy, question about Lebans' calendar
program.

I have a form that allows a user to click on different technicians.
When this happens, Lebans' calendar comes up with various dates set to
bold based on the technician selected. However, when I close the
calendar and select a different technician, the bold dates carry over
from the previous technician selected.

I can't find a way to clear the bold days after the user closes (or
before he opens) the calendar without creating different calander
objects for each technician. I'm sure there is a way, but I just can't
seem to find it.

Any help would be greatly appreciated.

MW


Nov 12 '05 #2

P: n/a
Stephen:

Thanks a lot for your response. I updated my calendar with your newest
version, but I'm still seeing the same issue. Here is the procedure I
have, which is almost identical to your examples. I have another
procedure exactly like this except for a more limiting SQL string. Each
time I call the calendar, it doesn't seem to clear the previously bolded
entries. I assume I'm missing something.

Private Sub cmdAllVisits_Click()
Dim strSQL As String
Dim rst As DAO.Recordset
Dim dbs As Database

Set dbs = CurrentDb

strSQL = "SELECT * FROM tblVisits " & _
"WHERE CallStatus='Open'"

Set rst = dbs.OpenRecordset(strSQL)
' Retrieve the currently selected date(s).
' Call our Function to display the Calendar
' Init the Calendar to select the date
' contained in this control.
' Position Calendar at cursor location when Calendar is created.
mc.PositionAtCursor = False

Do While Not rst.EOF
mc.SetBoldDayState DatePart("yyyy", rst!DateAssigned), DatePart("m",
rst!DateAssigned), DatePart("d", rst!DateAssigned)
rst.MoveNext
Loop

' Retrieve the currently selected date(s).
' Call our Function to display the Calendar.
' Defaults to showing Todays Date
' *** Only takes One Click to Select a Date and Close the Window ***
Dim blRet As Boolean
Dim dtStart As Date, dtEnd As Date

dtStart = Nz(Me.tboDateAssigned.value, 0)
dtEnd = 0

blRet = ShowMonthCalendar(mc, dtStart, dtEnd)

If blRet = True Then
Me.tboDateAssigned = dtStart
Me.tboRepDate = dtStart
End If
End Sub

Thanks again,

MW

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #3

P: n/a
Sorry Mason, I missed the part of your post where you stated you were
actaully SETTING the DayState prop!
In looking at the prop, the only way to clear the dates is to loop back
through the recordset you used to set the BoldDayState property using
the Optional ResetMonth boolean param to TRUE.

Really though, there should be a simple Method you can call to clear out
the DayState array.
Open the MonthCalendar class and add this code:

Public Sub ResetBoldDayState(reset As Boolean)
If reset Then
Erase BoldDayStates
End If
End Sub

Save the Code module and Compile the project.
Now to clear the DayState prop enter this line of code BEFORE you open
the Calendar.
mc.ResetBoldDayState True

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"Mason Wood" <ma***@codemonkey.cc> wrote in message
news:40*********************@news.frii.net...
Stephen:

Thanks a lot for your response. I updated my calendar with your newest version, but I'm still seeing the same issue. Here is the procedure I
have, which is almost identical to your examples. I have another
procedure exactly like this except for a more limiting SQL string. Each time I call the calendar, it doesn't seem to clear the previously bolded entries. I assume I'm missing something.

Private Sub cmdAllVisits_Click()
Dim strSQL As String
Dim rst As DAO.Recordset
Dim dbs As Database

Set dbs = CurrentDb

strSQL = "SELECT * FROM tblVisits " & _
"WHERE CallStatus='Open'"

Set rst = dbs.OpenRecordset(strSQL)
' Retrieve the currently selected date(s).
' Call our Function to display the Calendar
' Init the Calendar to select the date
' contained in this control.
' Position Calendar at cursor location when Calendar is created.
mc.PositionAtCursor = False

Do While Not rst.EOF
mc.SetBoldDayState DatePart("yyyy", rst!DateAssigned), DatePart("m", rst!DateAssigned), DatePart("d", rst!DateAssigned)
rst.MoveNext
Loop

' Retrieve the currently selected date(s).
' Call our Function to display the Calendar.
' Defaults to showing Todays Date
' *** Only takes One Click to Select a Date and Close the Window ***
Dim blRet As Boolean
Dim dtStart As Date, dtEnd As Date

dtStart = Nz(Me.tboDateAssigned.value, 0)
dtEnd = 0

blRet = ShowMonthCalendar(mc, dtStart, dtEnd)

If blRet = True Then
Me.tboDateAssigned = dtStart
Me.tboRepDate = dtStart
End If
End Sub

Thanks again,

MW

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Nov 12 '05 #4

P: n/a
Stephen:

I added that bit of code and it works beautifully. I can't thank you
enough for your help.

MW

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #5

P: n/a
Everyone here knows Lebans' code never worked and never will. Why don't you
let Lebans answer for his junk personally instead of bothering the group with
it?
In article <40*********************@news.frii.net>, ma***@codemonkey.cc says...

Stephen:

I added that bit of code and it works beautifully. I can't thank you
enough for your help.

MW

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Nov 12 '05 #6

P: n/a
ca******@hotmail.com (Carr Clifton) wrote:
Everyone here knows Lebans' code never worked and never will. Why don't you
let Lebans answer for his junk personally instead of bothering the group with
it?


Hmmm, this sure looks like a drive by posting by our favourite troll.

Oh, and rubbish. Stephen Leban's contributions are highly valued.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Nov 12 '05 #7

P: 1
Sorry to resurrect this thread.

I've been using the Leban MonthCalendar and have it working in a similar way to display dates where legal fisheries are occuring (this is a fisheries regulations database).

I was wondering if anyone knows how to alter the properties of the dates when the daystatebold property is true. I find that the font weight difference isn't that pronounced and I'd like to tweak it so that it draws highlighted days with a heavier font weighting, or perhaps a different color, so that they stand out more.

Would appreciate any ideas.
Thanks,
Craig
Feb 9 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.