I managed to use the code from D. Hookom on thread 703-896152, but am wondering if anyone knows what the function Get quarter may look like. I suspect he created a function that interprets the GetQtrStart and End dates but am not sure of how to recreate one.
Code:
Private Sub lboDates_AfterUpdate()
'============================================================
' Purpose:
' Copyright: Copyright 2003
' Programmer: Duane Hookom
' Called From:
' Date: 3/31/2003
' Parameters:
'============================================================
On Error GoTo lboDates_AfterUpdate_Err
Dim strErrMsg As String 'For Error Handling
Select Case Me.lboDates
Case "Clear"
Me.txtFromDate = Null
Me.txtToDate = Null
Case "This Yr"
Me.txtFromDate = DateSerial(Year(Date), 1, 1)
Me.txtToDate = DateSerial(Year(Date), 12, 31)
[COLOR=red]Case "This Qtr"
Me.txtFromDate = GetQtrStart(Date)
Me.txtToDate = GetQtrEnd(Date)[/color]
Case "This Mth"
Me.txtFromDate = DateSerial(Year(Date), Month(Date), 1)
Me.txtToDate = DateSerial(Year(Date), Month(Date) + 1, 0)
Case "This Wk"
Me.txtFromDate = DateAdd("d", -WeekDay(Date) + 1, Date)
Me.txtToDate = DateAdd("d", 6, Me.txtFromDate)
Case "Last Yr"
Me.txtFromDate = DateSerial(Year(Date) - 1, 1, 1)
Me.txtToDate = DateSerial(Year(Date) - 1, 12, 31)
[COLOR=red]Case "Last Qtr"
Me.txtFromDate = GetQtrStart(DateAdd("m", -3, Date))
Me.txtToDate = GetQtrEnd(DateAdd("m", -3, Date))[/color]
Case "Last Mth"
Me.txtFromDate = DateSerial(Year(Date), Month(Date) - 1, 1)
Me.txtToDate = DateSerial(Year(Date), Month(Date), 0)
Case "Last Wk"
Me.txtFromDate = DateAdd("d", -WeekDay(Date) + 1, Date) - 7
Me.txtToDate = DateAdd("d", 6, Me.txtFromDate)
End Select
lboDates_AfterUpdate_Exit:
On Error Resume Next
Exit Sub
lboDates_AfterUpdate_Err:
Select Case Err
Case Else
strErrMsg = strErrMsg & "Error #: " & Format$(Err.Number) & vbCrLf
strErrMsg = strErrMsg & "Error Description: " & Err.Description
MsgBox strErrMsg, vbInformation, "lboDates_AfterUpdate"
Resume lboDates_AfterUpdate_Exit
End Select
End Sub