Hello -
I have an option group called ReportType set up on a form with two options that will determine the date range selected for a report.
In the OnClick event of the button to open the report I have the following:
If Me.ReportType.Value = 1 Then
DoCmd.OpenReport "rptCorrectiveAction", acViewPreview, , "OccurrenceDate > " & DateAdd("m", -12, Date)
Else
DoCmd.OpenReport "rptCorrectiveAction", acViewPreview
End If
I do not receive any errors that my code is wrong but the report does not filter the dates.
Can someone please tell me what I am doing wrong?
I have an option group called ReportType set up on a form with two options that will determine the date range selected for a report.
In the OnClick event of the button to open the report I have the following:
If Me.ReportType.Value = 1 Then
DoCmd.OpenReport "rptCorrectiveAction", acViewPreview, , "OccurrenceDate > " & DateAdd("m", -12, Date)
Else
DoCmd.OpenReport "rptCorrectiveAction", acViewPreview
End If
I do not receive any errors that my code is wrong but the report does not filter the dates.
Can someone please tell me what I am doing wrong?