473,386 Members | 1,736 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Lebans' calendar

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
7 2611
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Larry R Harrison Jr | last post by:
Sometime, if an error has occured or even if a user has answered NO to a MsgBox Y/N question, the Lebans calendar control will prevent the form from closing. I know the Lebans calendar control...
5
by: Larry R Harrison Jr | last post by:
I use the Lebans calendar control and love it; the only thing is that it commonly starts out at the year 1899 rather than the current year. Is there a way to specifically tell it to start at the...
6
by: Mason | last post by:
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...
5
by: Michael Gramelspacher | last post by:
I am using Lebans's calendar with Access 97 running on Windows 95, and Access 2000 on a different machine also running Windows 95. I had been using an earlier version of the calendar without...
4
by: Andrew Chanter | last post by:
I recently installed Stephan Lebans calendar control into an application. Only problem is that it always launches at the extreme right of the screen with most of the dialog off screen. I am...
16
by: DFS | last post by:
If you're listening, I want the middle of the calendar (showing 1 month) to open below the cursor position. It currently opens just to the right and below the cursor position. I hunted through...
3
by: CuriousOne1 | last post by:
Hi all, I don't know if anyone has come accross this before. I've been using Steve Lebans Calendar control (available here: www.lebans.com/monthcalendar.htm ) for several database application...
5
by: Vaudousi | last post by:
Hi Dear Friends Is it possible to integrate Lebans calendar on a form in lieu and place of the Microsoft MonthView ? Many TKS in advance. José
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.