Creating a two-table query in Design View in Microsoft Access 2019

When we create a two-table query within Access, we need to ensurethat a relationship exists between the two tables prior to creating thequery. This is an important rule as the results will neither query norproduce the correct output if the tables are not related via a commonkey such as Code, in the databaseexample we are using for this demonstration. To create such a query,follow these steps:

  1. Make sure you have the database open from the previousexample. Click on the Create tab, then choose Query Design.
  2. Select the table on which you wish to base the new query. ClickAdd, then repeat the step to add asecond table. For this example, we are using the StudentsTbl, the ResultsTbl, and the SubjCodesTbl tables. Click on Close.
  3. Select fields from both tables’ lists by double-clicking to add themto the query grid. As we are requiring a query to produce subjectresults for all our grades, we will add the following fields from eachof the tables listed. Please view the following screenshot to add therelevant fields to the query grid:
ms office 731
  1. Add the criteria for the specific query requirements in the criteriarow.
  2. From the Design tab, locate theResults group. Click the Run icon. The query results are displayed inDatasheet View.
  1. Click on the Save icon on the QATand enter a query name called StudentMarksQry.
Use Ctrl + click to select morethan one table at a time when adding tables from the Show Table dialog box.

Leave a Comment