How to Create Relationships Between Queries in Microsoft Access
Microsoft Access databases are incredibly powerful. Queries allow you to search for and manipulate data within your database. By creating relationships between queries, you make the resulting query more effective. Relationships allow you to link fields within existing queries. You can link multiple fields for even tighter relationships. Relationships can extend between more than two queries.
Instructions
-
-
1
Open a Microsoft Access database with at least two existing queries. The two queries should have at least one field in common. For instance, one query may search for students under the age of 21, while another search for students age 18, but will share fields such as Name and Age.
-
2
Go to "Queries" in the database window. Click "Create Query in Design View."
If you have an existing query that you wish to create a relationship in, open the existing query in "Design View."
-
-
3
Choose the "Queries" tab and add the queries you wish to use. If using an existing query, skip this step.
-
4
Scroll down on both queries until you see the fields you wish to create the relationship with. This is also known as joining.
-
5
Drag the field from one query to the matching field in the other query. When a thin black line appears, the relationship has been created. Create the query as normal from this point on.
-
6
Create query relationships also by going to "Relationships" in the toolbar. Add tables and queries by clicking the "Show Table" icon. Follow Steps 4 and 5 to create the relationship.
-
1
Tips & Warnings
Create the relationship between queries in the query window if you only want the relationship to exist within that query. Create the relationship in the "relationships" window to exist throughout the database.
Creating relationships between too many fields may result in errors or duplicate results. Test queries carefully to ensure they work as you intended after creating relationships.
References
- Personal Experience