Lebans Calendar - Select a Date Range

  • Thread starter Thread starter Tom
  • Start date Start date
T

Tom

I installed Lebans Calendar to select a date range as described on the
Lebans web page and set it to be able to pick a lot of days and it
works fine. I then imported the modules and the form into another
database and it works, except I can only select a date range of 7 days
or less.

I imported the form and modules so all the code should be the same

The form load event is:

Private Sub Form_Load()


' Create an instance of our Class
Set mc = New clsMonthCal
' Set the hWndForm Property
mc.hWndForm = Me.hWnd
mc.MaxSelectRangeofDays = 5000

and the on click event for the command button is:

Private Sub cmdDateRange_Click()

' Retrieve the currently selected date(s).
' Call our Function to display the Calendar
Dim blRet As Boolean
Dim DateStart As Date
Dim DateEnd As Date
' If the control is NULL then use Today's date.
DateStart = Nz(Me.begin.Value, Date)
DateEnd = DateStart + 7

As it is on the first database. I can also try changing this value to
365 and it still only can select up to 7 days.

I've looked over the different place to add code and the references but
can't find any reason for this not to work.

Does anyone have any ideas?

Thanks
 
365 is the largest value accepted by the property. Anything over 365 will
default to 7 days. I would guess that you did not enter 365 but a larger
value than this when you tested.
If for some reason you need to change this behaviour just modify the Propert
in the clsMonthCal module. Here is the existing code:

Public Property Let MaxSelectRangeofDays(maxdays As Integer)
' Maximum days user can select in a range of dates.
If maxdays > 365 Or maxdays < 0 Then
m_MaxSelectRangeofDays = 7
Else
m_MaxSelectRangeofDays = maxdays
End If
CreateDTPControl
End Property

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
Back
Top