Function SetFilterDates(strLabelName As String)
Dim dtStart As Date
Dim iYear As Integer
'Start of this quarter.
dtStart = DateSerial(Year(Date), 3 * (DatePart("q", Date) - 1) + 1, 1)
'Start of this financial year.
iYear = Year(Date) - (Month(Date) > 6) - 1
Select Case strLabelName
Case "lblThisQtr"
Me.txtStartDate = dtStart
'Me.txtEndDate = DateAdd("q", 1, dtStart) - 1
Case "lblLastQtr"
'Me.txtEndDate = dtStart - 1
Me.txtStartDate = DateAdd("q", -1, dtStart)
Case "lblPriorQtr"
Me.txtStartDate = DateAdd("q", -2, dtStart)
'Me.txtEndDate = DateAdd("q", -1, dtStart) - 1
Case "lblThisYear"
Me.txtStartDate = DateSerial(iYear, 7, 1)
'Me.txtEndDate = DateSerial(iYear + 1, 6, 30)
Case "lblLastYear"
Me.txtStartDate = DateSerial(iYear - 1, 7, 1)
'Me.txtEndDate = DateSerial(iYear, 6, 30)
Case "lblPriorYear"
Me.txtStartDate = DateSerial(iYear - 2, 7, 1)
'Me.txtEndDate = DateSerial(iYear - 1, 6, 30)
Case Else
MsgBox strLabelName & " not handled.", vbInformation,
"SetFilterDates()"
End Select
End Function