Access - Group multiple items under a single query

December 2016




Issue


In the statistical framework for a supermarket, we want to know the origin of our customers to improve our marketing activities. We know how to create queries to extract the clients from a city or region in particular. Problem: the number of requests is important. Is there a way to group them under a single query, but that could be customized at runtime?

Answer


That is what we call a parameterized query. It expects parameter at launch. To do this, query design mode, in the area of the city field test for example, type in expression: [What City?]. The brackets are required. Access seems to recognize a field that does not exist in reality. In fact, implementation of the application, a dialog appears asking this question: Which city? The user then enters the city in question, New York and all the related items are extracted.

Related :

This document entitled « Access - Group multiple items under a single query » from CCM (ccm.net) is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the license, as this note appears clearly.