Access 2016: Create a Query with User Input
You can create a query that relies on user input. The value that the user provides determines the result set.
In Access, queries can accept parameters that can be used to determine the results of the query. When the query is run, the user is first prompted to enter a parameter (or multiple parameters). Once the parameter has been supplied, the query can return the results, based on the parameter provided.
For example, we previously created a query that returns all albums from Iron Maiden. This query could be modified so that it returns all albums from a given artist. The artist can be specified by the user.
Access makes this extremely easy to do. In fact, all you need to do is replace "Iron Maiden" with some text enclosed in square brackets.
So let's take a copy of the above query, and modify it so that the user gets prompted to enter an artist name when running the query.
Make a Copy of the Existing Query
Our new query is going to be almost the same as the previous one. So we can save some time and start with a copy of the existing one.
Modify the Query
Now we can modify the copied query to prompt the user for a parameter.