I have a table of data in Access 97 containing lots of records with different towns. I don’t want to create a query for each town, so how can I extract data depending on the particular town I want?
This is best down using what’s called an Access ‘parameter query’. When it’s setup and run, the query will prompt you for the particular town you want . The town is typed in and the query then extracts the data based on that town. The next time you run the query, it prompts you again, another town can be entered, and the new data is extracted.
This is how to set it up:
-
With the database task list showing, click the Queries tab and click the New button.
-
Leave Design View selected, then click OK.
-
Select the table you want to add to the query list, then click the Add button. You can add other tables if you want to combine data from different tables, but we’ll leave it at that so click the Close button.
-
Double-click the fields you wish to see in the final query result, which adds them to the query columns, and double-click the Town field.
-
Now we’ll enter the parameter query codes. Click inside the Criteria section under the field you want to query on, which in this case is Town.
-
Type the text [Which town do you want?] with the square brackets. The square brackets tell Access to display the dialogue box to enter the data you want to query when the query is run. The text between the square brackets is the message displayed in the dialogue box.
-
If the column is too narrow, double-click the mouse here:

Your screen should look something like this:

-
Click the Save button to save the query, enter a name, such as Town Query, then click OK.
-
When you double-click the query to run it, the message Which town do you want? appears in a dialogue box.

-
Type the town you want, exactly as it would appear in the actual data, then click OK. The extracted data then appears.
Unfortunately, you can’t use wild cards in a parameter query. Entering W* in the dialogue box, for example, will not extract Wodonga, Walwa, Walla, and so on. The asterisk, *, is seen as an actual text character.
// Related Posted - GOOGLE!
Related Websites
- Twitter launches it's own Tweet Button Twitter, the famous microblogging site has now launched it's own Tweet Button. The new Tweet Button has a simple and...
- Week in Tweets Ending Saturday 2009-06-27 FREE Send Large Files Easily By Jim Corbett When It Absolutely Positively Has To Be There Today for free (http://ping.fm/MLMcz)...
- How to catch hackers on your wireless network [/caption] Wireless networks are a wonderful invention. They give us the ability to easily deploy a complex network of computers...
- Outlook 2007 tips While I'm on the subject of tips, here are a few tips for Outlook 2007. 1) Stop Outlook from suggesting...
- Advice For Multilingual SEO. Part 1 Consider all the possibilities. Living as I do on the conjunction of three countries, that is Belgium, Holland and Germany,...
