I have some code that slectes the previous months dates and changes the selected dates of my calendars.
However, the calendar still displays the current month even though the selected date is the previous month.
Is there a differant setting I should be setting or a way to refresh the calendar?
VB Code:
Dim mm As Integer Dim yy As String Dim dtedate As Date Dim dtedate1 As Date mm = Date.Today.Month yy = Date.Today.Year If mm <> 1 Then dtedate1 = mm.ToString.Trim() & "/01/" & yy.ToString dtedate1 = dtedate1.AddDays(-1) dtedate = mm - 1.ToString.Trim() & "/01/" & yy.ToString Else yy -= 1 dtedate = "12/01/" & yy.ToString dtedate1 = "12/31/" & yy.ToString End If Calendar1.SelectedDate = dtedate Calendar2.SelectedDate = dtedate1
Thanks


Reply With Quote