Others

Create Dynamic Year and Month Criteria in a Microsoft Access Query

Maira MehtabMaira Mehtab Nov 27, 2026 869 views

Question details

Filter an Access report by the current year and month or by a period selected on a form.

Create Dynamic Year and Month Criteria in a Microsoft Access Query
Product
Microsoft Access
Device & OS
not provided
Scenario
A query supplies records to a report that needs a dynamic monthly filter.
Observed behavior
The report should show records for either the current month or the year and month selected by the user.
Before you start

Identify the report's record source and the date field to filter. For a user-selected period, create a form with combo boxes that return numeric year and month values.

Solution 1Recommended

Filter the Access query to the current month

Use a date range that updates automatically whenever the query or report runs.

1
Open the query in Design View

In the Navigation Pane, right-click the query used by the report and select Design View.

2
Add the date criteria

Add the date field to the query grid if needed. In its Criteria row, enter: >=DateSerial(Year(Date()), Month(Date()), 1) And <DateSerial(Year(Date()), Month(Date())+1, 1)

3
Run the report

Save the query, confirm it is selected in the report's Record Source property, and open the report to check the current month's records.

Filter the Access query to the current month
Why use a date range?: The inclusive start and exclusive end include records with time values on the last day of the month. Like is unnecessary because this is not a wildcard search.
Free Microsoft Office alternative

Work with monthly data in WPS Office

WPS Office is a free, lightweight alternative for working with familiar Office documents and spreadsheets. Its familiar interface and Microsoft Office format compatibility make it easy to move everyday files, although it does not replace or fix Microsoft Access queries and reports.

Organize and review monthly data in WPS SpreadsheetsOpen and edit Microsoft Excel XLSX filesWork with Word DOCX and PowerPoint PPTX filesUse a familiar interface for everyday office tasks
microsoft office alternative - wps office

Frequently Asked Questions

How do I automatically show the current month in an Access report?

In the report's source query, set the date field's Criteria to >=DateSerial(Year(Date()), Month(Date()), 1) And <DateSerial(Year(Date()), Month(Date())+1, 1). The range updates when the query runs.

Why does Access prompt me for a form control value?

Check that the form is open and that the names in Forms!FormName!ControlName match the actual form and control names. Also confirm that both period controls have values.

Can I filter a report if year and month are stored in separate fields?

Yes. Use equality criteria for each numeric field, such as Forms!frmPeriod!cboYear under the year field and Forms!frmPeriod!cboMonth under the month field in Query Design View.

Should I use Like for the year and month criteria?

No. Use equality for numeric year and month fields, or a DateSerial range for a date field. Like is intended for pattern matching with wildcards.