B
Bayou BoB
Hello!
I'm using the following option group code to filter reports by
age......month, quarter, and year. I am looking to do two things here.
First I'm looking for a fix for the "quarterly" code...It is not
working properly and needs to be adjusted.
Secondly I am looking to add options here...primarily the following,
"Last 14 Days"
"Last 30 Days"
"Last 90 Days"
"Last 180 Days"
"Last 365 Days"
What would the appropriate Code be for this? Here is the case code I'm
presently using and want to add options to...
Private Sub Command11_Click()
On Error GoTo Err_Command11_Click
Dim stDocName As String
Dim stWhere As String
stDocName = "CLI_DetailedAttendance_Rep"
Select Case [Frame0]
Case 1 'Current month
stWhere = "Month([Date]) = " & Month(Date) & "And Year([Date])
= " & Year(Date)
Case 2 'Current quarter
stWhere = "DatePart("q", [Date]) = " & DatePart("q", Date)& "
And Year([Date]) = "& Year(Date)
Case 3 'Current year
stWhere = "Year([Date]) = " & Year(Date)
End Select
DoCmd.OpenReport stDocName, acPreview, , stWhere
Many Thanks!
Kevin
I'm using the following option group code to filter reports by
age......month, quarter, and year. I am looking to do two things here.
First I'm looking for a fix for the "quarterly" code...It is not
working properly and needs to be adjusted.
Secondly I am looking to add options here...primarily the following,
"Last 14 Days"
"Last 30 Days"
"Last 90 Days"
"Last 180 Days"
"Last 365 Days"
What would the appropriate Code be for this? Here is the case code I'm
presently using and want to add options to...
Private Sub Command11_Click()
On Error GoTo Err_Command11_Click
Dim stDocName As String
Dim stWhere As String
stDocName = "CLI_DetailedAttendance_Rep"
Select Case [Frame0]
Case 1 'Current month
stWhere = "Month([Date]) = " & Month(Date) & "And Year([Date])
= " & Year(Date)
Case 2 'Current quarter
stWhere = "DatePart("q", [Date]) = " & DatePart("q", Date)& "
And Year([Date]) = "& Year(Date)
Case 3 'Current year
stWhere = "Year([Date]) = " & Year(Date)
End Select
DoCmd.OpenReport stDocName, acPreview, , stWhere
Many Thanks!
Kevin