Others

Create a Month and Year Parameter Query in Microsoft Access

Anum MushtaqAnum Mushtaq Nov 25, 2026 869 views

Question details

Let users enter a month and year once when running an Access query that contains four subqueries.

Create a Month and Year Parameter Query in Microsoft Access
Product
Microsoft Access
Device & OS
not provided
Scenario
A query combines results from four payment tables, and each subquery currently uses hard-coded month and year values.
Observed behavior
The goal is to prompt for one month and one year and apply those values throughout the query.
Before you start

Open the database and locate the query and its four subqueries. Check where each subquery filters by month and year so you can replace every hard-coded value.

Solution 1Recommended

Use shared month and year parameters in all four subqueries

Replace the fixed values with identically named parameters and declare their data types so Access can reuse the entered values.

1
Open the query for editing

In the Navigation Pane, right-click the query and select Design View. Switch to SQL View from the View menu if the subqueries are easier to edit in SQL.

2
Replace the fixed values

In each of the four subqueries, replace the hard-coded month criterion with [Enter Month] and the hard-coded year criterion with [Enter Year]. Keep the parameter names identical everywhere they appear.

3
Declare the parameters

In Query Design view, select Design > Parameters. Enter Enter Month and Enter Year exactly as used in the query, and set each Data Type to Long Integer.

4
Save and test the query

Save the query, then select Run. Enter a numeric month from 1 to 12 and a four-digit year when prompted, and check that the results include the expected payments.

Use shared month and year parameters in all four subqueries
Check each subquery: If Access displays an unexpected extra prompt, check for a misspelled parameter name or field name in the query.
Free Microsoft Office alternative

Work with payment spreadsheets in WPS Office

WPS Office is a free, lightweight alternative with a familiar interface for working with Office documents and spreadsheets. It can help you review payment data exported from Access, but it does not run or fix Access database queries.

Review and filter exported payment data in WPS SpreadsheetCompatible with Microsoft Excel XLSX and XLS filesFamiliar spreadsheet interface for an easier transitionFree, lightweight suite for everyday document work
microsoft office alternative - wps office

Frequently Asked Questions

Will Access prompt for the month and year only once?

Access can reuse each entered value throughout the query when every occurrence uses the exact same parameter name. Declare both names under Design > Parameters.

What should I enter for the month parameter?

Enter a number from 1 through 12 when the Enter Month prompt appears. The query must compare that parameter with a numeric month value.

Why does Access show an unexpected parameter prompt?

A misspelled parameter or field name can cause another prompt. Check the names in all four subqueries and compare the parameter names with those listed under Design > Parameters.

Can WPS Office run my Access parameter query?

No. Run the query in Microsoft Access. If you export its results to an Excel file, you can open and review that file in WPS Spreadsheet.