is there a better way to do this, it looks so cheesy
it grabs the first of this month and 1st of last month using monthcalendars
VB Code:
Dim dtMonth, dtMonth2, dtYear, dtYear2 As Int16 dtMonth = Format(MC2.TodayDate, "MM") dtYear = Format(MC2.TodayDate, "yyyy") dtYear2 = dtYear 'get last months number dtMonth2 = dtMonth - 1 ' if month = january If dtMonth2 = 0 Then dtMonth2 = 12 dtYear2 -= 1 End If 'set monthcalender MC1.SetDate(dtMonth2 & "/1/" & dtYear2) MC2.SetDate(dtMonth & "/1/" & dtYear)
but then again it does work


Reply With Quote