Solved

Calendar - Select a period

Posted on 2003-10-22
7
347 Views
Last Modified: 2010-05-01
I'd like to select not just a day but a period with calendar (multiple days)
Does anyone know a way to do that?
0
Comment
Question by:meciab
7 Comments
 

Expert Comment

by:Eddiebaby
ID: 9598728
I don't think that you can do this with just one calendar control.

The best thing to do is to have two calendar controls, with the user selecting the from date in the first box and the to date in the second.

Add validation code to ensure that the date range is valid - e.g that the first date is older than the second.

Ed
0
 

Author Comment

by:meciab
ID: 9598784
Yes I ever user this solution but it doesn't fit with my needs cos' I want for exemple select monday an wedneday of two weeks.
0
 
LVL 39

Accepted Solution

by:
appari earned 500 total points
ID: 9598794
you can use monthview control
in vb ide press CTRL+T select  microsoft windows common controls-2 6.0. you can see monthview control.
set MultiSelect property to true.
set MaxSelCount tono of days you want to allow to select.

from selection

MsgBox MonthView1.SelStart    returns start day selected
MsgBox MonthView1.SelEnd      returns end day selected
 
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:meciab
ID: 9599218
Thanks but even with multiselect property you can't select (even with ctrl) for exemple the 1,4,13,19 and 28 of the month.
And if you display 3 months you can't select a period on this 3 months you can just select a period on the same month.
0
 

Author Comment

by:meciab
ID: 9599417
...oupss sorry you can select a continuous period on 3 months. But you can't select a discontinuous period
0
 

Expert Comment

by:eliaslopezgtz
ID: 9601156
you can create a custom control that loads calendar controls at run time... and get the intervals you need.
0
 
LVL 5

Expert Comment

by:JCinDE
ID: 9601862
Use a listbox to display selected dates and a DatePicker control to add new ones. It's not as pretty as having the calendar highlight all the days, but it's functional.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now