Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Monthview - selecting multiple dates at a time

Status
Not open for further replies.

Corinne

Programmer
May 15, 2001
146
US
I'd like to include a monthview control on a form. I would like the user to go to the monthview and select multiple dates from the control by clicking on the dates. How should I retreive the data information once the user is done selecting the dates? I have already set the monthview property MaxSelCount to the max quantity they would select. I just need some direction on how to gather all of the dates once they click on them in the monthview. Once I get these dates they will be needed to populate labels on a data report. Any direction would be helpful.

Thanks,
Corinne
 
Help says:
You can allow end users to select a contiguous range of dates by setting the MultiSelect property to True, and specifying the number of selectable days with the MaxSelProperty. The SelStart and SelEnd properties return the start and end dates of a selection.


You could use the SelChange event to grab both start and end dates whenever they change the selection.

Private Sub MonthView1_SelChange(ByVal StartDate As Date, ByVal EndDate As Date, Cancel As Boolean)
Debug.Print StartDate & " -> " & EndDate
End Sub
 
Thanks for responding,

I saw that in help. I wasn't sure how to use the startdate and enddate when the user would be selecting just work days, not a continous run of days together. I'd prefer if the user could just select up to 22 days a month by clicking on the days without my code going through and determining which are weekends and which may be holidays & the leap year issue.

Corinne
 
I don't believe that the control will allow you to select different dates at random, they must be in a continuous run.

The only way to do what you want would be to make your own control and keep adding the dates to a collection (or something) as they click the dates.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top