Lebans Calendar - Restrict date range selection

  • Thread starter Thread starter John D
  • Start date Start date
J

John D

Greetings,
I've successfully integrated Stephen Lebans' Calendar into my A2K
application.
However, I need to glean 3 pieces of information from the calendar.
A starting date, a returning date, and NOT every consecutive date in
between the start date and returning date. I call the calendar to
collect the start date, I call the calendar again to collect the
returning date, then once again to select a range. Now here's where I
need the wisdom of my peers here in this forum. How do I tell the
calendar to restrict the user from selecting any dates outside of the
preselected start date and the returning date?

Thank you in advance.

John D
 
I'm afraid I do not follow your logic. You do realize that you can call
the calendar to return a range of dates so you do not have to call the
Calendar multiple times.
There is currently no method to restrict the Calendar to a preset range
of dates but you could add this functionality yourself quite easily if
you are into programming. Otherwise simply examine the date returned by
the calendar. If it is outside of the desired range then pop a MsgBox to
tell the naughty user what they did wrong and then pop the Calendar back
up again.

Finally, yesterday I uploaded a new version of the Calendar that fixes a
few more bugs/issues.
--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
Stephen Lebans said:
I'm afraid I do not follow your logic. You do realize that you can call
the calendar to return a range of dates so you do not have to call the
Calendar multiple times.
There is currently no method to restrict the Calendar to a preset range
of dates but you could add this functionality yourself quite easily if
you are into programming. Otherwise simply examine the date returned by
the calendar. If it is outside of the desired range then pop a MsgBox to
tell the naughty user what they did wrong and then pop the Calendar back
up again.

Finally, yesterday I uploaded a new version of the Calendar that fixes a
few more bugs/issues.
--

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

Stephen,
Thank you for your response.
The reason that I display the calendar the way that I do is because I
need to communicate to the user what I need them to specify via the
Forms Caption property. Oh yea, I failed to mention, and I hope that
modifying your code is ok, I added a paramenter to the
ShowMonthCalendar function to allow me to display whatever I need in
the Forms Caption by passing it a string.
Example:
I display the calendar the first time and put "Specify the Ship Date"
in the Form's caption. The user picks the date and I store it in a
variable. Next, I display it again only this time it reads "Specify
the Return Date." Then once they've selected a date, I compare it
against the date that they picked for the Ship date and display a
message if there's a problem and redisplay the calendar. (Like you
said). Lastly, the user needs to specify a range of dates between the
Ship date and the Return date. However, that range may not necessarily
be the entire range between the Ship date and the Return date. At this
point I qualify the range of dates and take action accordingly.

That is my logic. If you've got a better idea. I'm all ears.
Thanks again and let me know if you come up with something to restrict
the range of dates based on limits passed to the calendar.
I will try to work it mysaelf. If I get it to work, I will let you
know.

Great Calendar Steve!!

John D
 
John you are certainly free to customize the control for your specific
app and I encourage this.
I now understand your logic and see no way to change this interface
without modifying the calendar to restrict itself to a specified range
of dates.
If you come up with solution please let me know!
:-)

--

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