I'm having trouble getting my filter to work.
I'm trying to get a report to filter the month and year from a date. I have fields for the month and the year on the report, x and y.
I'm extracting the month and year from the date field in the form.
I get a syntax erro on the code, and think I'm missing a quote of something:
I'm trying to get a report to filter the month and year from a date. I have fields for the month and the year on the report, x and y.
I'm extracting the month and year from the date field in the form.
I get a syntax erro on the code, and think I'm missing a quote of something:
Code:
dYear = DatePart("yyyy", Me.DateOfReport)
dMonth = Month(Me.DateOfReport)
DoCmd.OpenReport "rptMonthlyReportFlagging", acViewPreview, ,_
"x =" & dMonth And "y =" & dYear