SelChange Event Example

The example prints out the range of dates selected by the user. To try the example, place a MonthView control on a form and paste the code into the Declarations section of the code module. Start the project and select various date ranges (set the MultiSelect property to True).

Private Sub MonthView1_SelChange(ByVal StartDate As Date, ByVal EndDate As Date, Cancel As Boolean)
   Dim d As Date
   d = StartDate
   Debug.Print "Start"
   While d <= EndDate
      Debug.Print d
      d = d + 1
   Wend
   Debug.Print "End"
End Sub