18 min read
Parameter Queries
Type [Enter city:] in Criteria. Access prompts at run time.
You will learn: parameter syntax with square brackets. You will do: build MembersByCity. run it for London and Manchester.
Parameter Syntax
Replace a fixed value with bracketed prompt text:
[Enter city:]
Access shows a dialog before the result. Whatever you type is used as the criterion for that run.
Build MembersByCity
Goal
Build one query that lists members for any city staff type.
No need to save a separate query per city.
Create a query on Members
Where
Do this
Verification
Check your work
You are correct if all of these are true:
- Access prompts Enter city: before showing the result.
- Typing different cities returns different member lists.
SOURCE DATA
| Members | |||
|---|---|---|---|
QUERY DESIGN
| Grid — MembersByCity | ||
|---|---|---|
CRITERIA
[Enter city:] — Access prompts Enter city: at run time.
RESULT — staff types London
| Result: MembersByCity (London) | |
|---|---|
RESULT — staff types Manchester
| Result: MembersByCity (Manchester) | |
|---|---|
Parameter on Loans
Goal
List open loans for a member ID staff type at the desk.
Combine a parameter with Is Null on ReturnDate.
Add Loans
Where
Do this
Verification
Check your work
You are correct if all of these are true:
- Only open loans for the typed member ID appear.
Practice
Swipe or use the arrows to move between questions.
1 / 2
More lessons in Microsoft Access · Next: What Is a Form, and Why Use One? · Previous: The SQL View: Peeking Under the Hood
