M
Mary
I'd like to add buttons for current year and previous year to a form. The
report is pulling all records. The field in the underlying query is DueDate,
the field on the report is DueD.
There is an if statement that determines which table to pull the date from:
Last(IIf([Grooms_Activity_Dates].[DueDate] Is Not
Null,[Grooms_Activity_Dates].[DueDate],[Grooms_Ckts].[DueDate])) AS DueD
Can you help fix my strWhere statement so it will only pull current year
records?? I've tried a couple different variations with Year(DueDate) and
Year(DueD), but nothing has worked so far.
I'll want to do the same for the previous year.
Private Sub Command106_Click()
On Error GoTo Err_Command106_Click
Dim stDocName As String
Dim strWhere As String
stDocName = "Cancelled"
strWhere = Year(Date)
DoCmd.OpenReport stDocName, acPreview
Exit_Command106_Click:
Exit Sub
Err_Command106_Click:
MsgBox Err.Description
Resume Exit_Command106_Click
End Sub
Thank you!
Mary
report is pulling all records. The field in the underlying query is DueDate,
the field on the report is DueD.
There is an if statement that determines which table to pull the date from:
Last(IIf([Grooms_Activity_Dates].[DueDate] Is Not
Null,[Grooms_Activity_Dates].[DueDate],[Grooms_Ckts].[DueDate])) AS DueD
Can you help fix my strWhere statement so it will only pull current year
records?? I've tried a couple different variations with Year(DueDate) and
Year(DueD), but nothing has worked so far.
I'll want to do the same for the previous year.
Private Sub Command106_Click()
On Error GoTo Err_Command106_Click
Dim stDocName As String
Dim strWhere As String
stDocName = "Cancelled"
strWhere = Year(Date)
DoCmd.OpenReport stDocName, acPreview
Exit_Command106_Click:
Exit Sub
Err_Command106_Click:
MsgBox Err.Description
Resume Exit_Command106_Click
End Sub
Thank you!
Mary