Create a parameter query in Access

Instead of building one query per country, month or payment method, a parameter query asks for the value when it opens. One query, many lists.

In short: write a question in square brackets as the criterion, such as [Which country?]. Because Access knows no field by that name, it shows the “Enter Parameter Value” box when the query runs and uses the answer as the criterion.

Before you start: Calculated fields and criteria from level 1.

Try it now

In the exercises nobody types the answer: the exercise supplies the value and shows it below the result. The hidden check enters a different value, so a fixed country is caught.

Task Build a query that asks for the country when it opens: Company, LastName and City of the customers in the country entered. The exercise enters UK.

Customers 25 rows, 10 columns
CustomerIDCompanyFirstNameLastNameCityPostalCodeCountryCustomerSinceRegularDiscount
1NoahEvansLeedsLS1 1URUK28 Feb 2023☑0.1
2Shaw & PartnersNoahDaviesGlasgowG1 1XQUK5 Feb 2024☐0.03
3Northlight IncSophiaHallDenver80202USA30 Jun 2024☑0
4OliviaEvansBristolBS1 4DJUK29 Jun 2022☑0
5OliviaSmithLondonEC1A 1BBUK23 Sep 2025☑0
6Northlight IncMiaEvansManchesterM1 1AEUK1 Feb 2025☐0.1
7Bauer LtdAvaWilsonUK14 Oct 2024☐0.05
8LucasTaylorGlasgowG1 1XQUK2 Jul 2023☐0
9JackClarkSeattle98101USA7 Nov 2022☐0.1
10Northlight IncHenryTaylorDenver80202USA3 Nov 2022☑0.1
11Northlight IncOliverJohnsonBristolBS1 4DJUK6 Mar 2024☐0
12HenryTaylorChicago60601USA24 Dec 2023☐0
13Northlight IncNoahTaylorLondonEC1A 1BBUK12 Oct 2022☐0
14Summit ConsultingMiaSmithAustin78701USA6 Feb 2022☑0
15MiaClarkAustin78701USA9 Mar 2022☑0.05
16ChloeHallSeattle98101USA4 May 2022☐0.03
17Market Street ClinicSophiaJohnsonBoston02108USA4 Jun 2023☑0
18Roth LegalMiaWrightManchesterM1 1AEUK23 Sep 2022☑0.05
19Northlight IncGraceWrightUK16 Dec 2023☐0.03
20Northlight IncOliviaBrownBoston02108USA19 Jun 2023☐0.03
21LiamBrownBoston02108USA23 Jun 2025☐0.03
22Bauer LtdJamesJohnsonManchesterM1 1AEUK5 Jun 2025☐0.05
23NoahWilsonAustin78701USA23 May 2022☐0
24Market Street ClinicJamesSmithBristolBS1 4DJUK16 Jan 2022☐0.1
25Northlight IncSophiaHallDenver80202USA4 Aug 2025☑0

How a parameter works

When the query runs, Access goes through every name in it. Anything that is neither a field nor a function becomes a parameter: Access opens a box with the bracket text as the question. The answer replaces the parameter, then the query runs as with a fixed criterion.

Criterionasks forfinds
[Which country?]a countryexactly that country
Like [Name begins with?] & "*"the start of a nameall names with that start
Between [From?] And [To?]two datesthe period in between

The bracket text may contain spaces and question marks, but must not match a field name, or Access uses the field.

Task Accounts needs the orders per payment method: OrderID and OrderDate, asking for the payment method, sorted by order date. The exercise enters PayPal.

Orders 120 rows, 6 columns
OrderIDCustomerIDOrderDateShippedDateFreightPaymentMethod
11630 Apr 20253 May 20254.90Invoice
22318 May 202526 May 20254.90PayPal
31916 Jul 20264.90Direct debit
41131 Mar 20251 Apr 20250.00Invoice
567 Dec 20259 Dec 20259.90PayPal
61819 May 202626 May 20266.90Direct debit
7715 Jun 202616 Jun 20264.90Credit card
82018 Mar 202519 Mar 20250.00PayPal
91029 Oct 20253 Nov 20250.00Direct debit
10721 Nov 20264.90Invoice
1112 May 202510 May 20259.90Direct debit
12107 Aug 20259 Aug 20250.00Invoice
13317 Sep 202624 Sep 20269.90PayPal
141629 Jan 20261 Feb 20266.90Invoice
15413 Jun 202521 Jun 20254.90PayPal
16123 Nov 202512 Nov 20254.90Invoice
1795 May 20268 May 20269.90PayPal
18926 Sep 20252 Oct 20254.90PayPal
19148 Mar 202610 Mar 20260.00Credit card
2012 Apr 20266.90PayPal
211817 Nov 20264.90PayPal
221127 Jul 20264 Aug 20264.90PayPal
231223 Jun 202628 Jun 20264.90Credit card
241012 Jan 202616 Jan 20260.00Direct debit
25130 Mar 202631 Mar 20264.90Credit card
2633 Mar 20257 Mar 20254.90Invoice
27249 Mar 202511 Mar 20254.90PayPal
28122 Sep 202528 Sep 20254.90PayPal
29118 Feb 202522 Feb 20254.90Invoice
301913 Oct 202518 Oct 20254.90PayPal
311019 Sep 202525 Sep 20256.90PayPal
32619 Jun 202624 Jun 20264.90Credit card
332016 Jun 202622 Jun 20269.90Credit card
341323 May 202627 May 20269.90Direct debit
351624 May 20262 Jun 20264.90PayPal
36149 Nov 202614 Nov 20264.90PayPal
37311 Mar 202618 Mar 20269.90PayPal
38222 Jan 202510 Jan 20250.00Invoice
391221 Oct 202527 Oct 20250.00Invoice
40204 Nov 20265 Nov 20269.90PayPal
411729 Mar 202630 Mar 20264.90PayPal
42136 Jan 20268 Jan 20260.00Invoice
43324 Feb 202626 Feb 20264.90PayPal
44721 Sep 202628 Sep 20264.90Invoice
45217 Apr 202523 Apr 20250.00Direct debit
46727 Apr 202628 Apr 20264.90Invoice
47316 Nov 20266.90Direct debit
48126 Jun 202627 Jun 20264.90Credit card
492429 Apr 202630 Apr 20264.90PayPal
50123 Mar 202528 Mar 20254.90Direct debit
511028 Jan 202631 Jan 20260.00PayPal
52229 May 202615 May 20264.90Direct debit
531029 Dec 20257 Jan 20260.00Credit card
54417 Oct 202618 Oct 20269.90Credit card
552430 Aug 202531 Aug 20256.90Credit card
56629 Jan 20262 Feb 20264.90PayPal
571810 Dec 202513 Dec 20256.90Direct debit
58134 Mar 20259 Mar 20259.90Invoice
591129 Nov 20257 Dec 20256.90Invoice
60930 Oct 20254 Nov 20254.90Invoice
611017 Mar 202619 Mar 20264.90PayPal
62914 Jul 202521 Jul 20254.90PayPal
63824 May 20252 Jun 20250.00Invoice
64429 Sep 20265 Oct 20264.90Invoice
651022 Jan 202627 Jan 20269.90Invoice
66927 Mar 202628 Mar 20269.90Credit card
671411 Sep 202618 Sep 20264.90PayPal
6849 Jun 202616 Jun 20260.00Invoice
691710 Jan 202617 Jan 20269.90Credit card
70211 Apr 20262 Apr 20264.90Credit card
711519 Mar 202521 Mar 20254.90Credit card
72204 Mar 20256 Mar 20254.90Invoice
731024 May 20259.90PayPal
7483 Jan 20254 Jan 20259.90Invoice
752330 Oct 20256 Nov 20259.90Direct debit
762230 Aug 20253 Sep 20256.90Invoice
77218 Nov 202523 Nov 20256.90PayPal
78322 Dec 202526 Dec 20254.90Invoice
792126 May 20266.90Invoice
802423 Feb 202627 Feb 20264.90Direct debit
8125 Jun 20266.90PayPal
821114 Aug 20266.90Invoice
832110 May 202618 May 20269.90Credit card
841312 Feb 202519 Feb 20254.90Credit card
85222 Jan 202630 Jan 20264.90PayPal
86231 Oct 20254 Nov 20259.90Credit card
8769 Mar 202517 Mar 20259.90Credit card
8835 Feb 202514 Feb 20259.90Direct debit
891726 Jan 202529 Jan 20256.90PayPal
901125 Sep 20264.90Direct debit
912223 May 20251 Jun 20254.90Credit card
922029 Jan 20252 Feb 20250.00PayPal
93816 Jul 202618 Jul 20266.90Invoice
9427 Aug 202510 Aug 20250.00Invoice
95226 Jan 20258 Jan 20256.90Credit card
961515 Dec 202524 Dec 20254.90Invoice
97623 Sep 202530 Sep 20256.90Invoice
981010 Sep 202516 Sep 20250.00Invoice
991410 Jan 202613 Jan 20269.90Credit card
1001620 Nov 202524 Nov 20250.00Credit card
1011826 Jul 202627 Jul 20264.90Credit card
102215 May 20259.90Invoice
10348 Feb 202515 Feb 20256.90Credit card
104716 Sep 202617 Sep 20264.90Invoice
105726 Jan 202531 Jan 20254.90Direct debit
106232 Aug 20263 Aug 20266.90Direct debit
1071322 Jan 202626 Jan 20269.90Credit card
10846 Oct 202514 Oct 20254.90Direct debit
109106 Nov 20259 Nov 20254.90Direct debit
110917 Oct 202618 Oct 20269.90PayPal
1112324 May 202625 May 20266.90Direct debit
112231 Aug 20251 Sep 20259.90Direct debit
1132025 Jul 202628 Jul 20260.00Direct debit
114624 Nov 202527 Nov 20259.90Credit card
115827 Nov 202530 Nov 20256.90Credit card
116118 Mar 202525 Mar 20250.00Direct debit
117916 Mar 202519 Mar 20256.90Credit card
118410 Jul 202615 Jul 20260.00Invoice
1191423 Jun 202528 Jun 20254.90Direct debit
120221 Sep 202627 Sep 20264.90Direct debit

This exercise is part of Premium.

Premium unlocks every exercise in every lesson, unlimited practice with fresh tasks and the final test with certificate.

See Premium Already Premium? Log in

The first exercise in this lesson is free.

In real Access

  1. In query Design view, enter [Which country?] under the field.
  2. Run: the “Enter Parameter Value” box appears with your question. Type the value, OK.
  3. For dates and numbers it pays to set the data type: Query Design tab, Parameters, enter the name (exactly as in the criterion) and the data type. Access then checks the entry right away.
  4. Save. Every time it opens it asks again; a form or report based on the query asks too.

Common mistakes

An unwanted parameter

If Access asks for a value although you wanted no parameter, a field name is almost always misspelled. The box shows the name Access does not know.

Two spellings

[From?] and [from ?] are two parameters, so Access asks twice. Use exactly the same text for the same value.

An empty answer

If the box is left empty, the parameter is Null and =[Which country?] finds nothing. With Like [Which country?] & "*" an empty answer shows every country.

FAQ

Can a form field replace the box?

Yes, with a reference like [Forms]![Search]![Country]. The query then reads the value from the open form. That comes in level 5.

How many parameters can a query have?

Several are fine; Access asks one after the other.

Learn next: totals query

Count, sum and average, grouped by country or payment method.

Totals query

Write to us

Choose language

Select your preferred language