Pulling Data From Multiple Tables Into a Single Query in MS Access

Sometimes an Access database user needs totables, then a little more work is required to link
pull pieces of information from multiple tablethe tables. Let us consider an example to better
sources to display on a single form. For manyillustrate this process. Assume you have two
users, this can seem like a daunting task.tables. One table contains an automatically
However, with a few tips and a little practice, younumbered Primary Key. The table contains one
can learn to link database tables with littleother field besides the Primary Key. This field
headache. The easiest way to accomplish this iscontains descriptions of options a user can select
to make use of the "Primary Key" option(e.g. "yes", "no", "other", etc.) stored as strings.
provided in MS Access. The Primary Key is aThis type of table is known as a "list" table or a
unique identifier that classifies the data in a table."static" table because the data does not change.
By representing data in different tables with theThe other table contains account information for
same Primary Key, linking tables is relatively easy.customers at a small business. One of the fields
The first step is to create a new query. Once thedisplays whether or not the customer has paid
query has been created and named, open thetheir outstanding bill.
query in "Design View" to view the inner workingsIn the newly created query, the user must link
of the query. Since this is a new query, therethe two fields. The linking between the two tables
should not be any tables listed in the viewer.can be accomplished using the "Criteria" option in
Select the "add table or query" option to selectthe viewer. Below is an example of how to link
the tables you would like to link.the data in the dynamic and static tables:
If the Primary Key for the tables selected is theDynamic Table:
same for each table, then linking the tables is"[Static Table Name].[Static Table Field Name]"
easy. Simply select the field set as the primaryThe two tables have now been linked! Use this as
key and drag it to the corresponding table'sa template for linking your own tables within a
primary key. The tables are now linked by thequery. With a little practice, you will be able to
uniquely identifying Primary Key. Information fromcreate more complex queries, helping you
either table can now be displayed in the querybecome more efficient and organized within your
when it is run.database.
If the Primary Key differs between the selected