Help with linking tables in a query (1 Viewer)

viscera

New member
Local time
Today, 09:08
Joined
May 7, 2021
Messages
2
I haven't worked with Access for several years, and I'm a bit rusty. I need help with a matching query. My database contains 2 tables. One has several data fields. The other has a single field from an external source. This single field is common to both tables. I am looking to link the 2 tables in order to pull the other data fields from the "main" table when the common field's data is matched. Thanks.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 06:08
Joined
Oct 29, 2018
Messages
21,467
  1. Create a query
  2. Add both tables on the design grid
  3. Drag the common field from one table to the other
  4. Add all the fields you want to display from the table down into the query grid
  5. Run the query
 

Umpire

Member
Local time
Today, 06:08
Joined
Mar 24, 2020
Messages
120
  1. Create a query
  2. Add both tables on the design grid
  3. Drag the common field from one table to the other
  4. Add all the fields you want to display from the table down into the query grid
  5. Run the query
I have a form where I am trying to use the data from one table on the main form and the data from a second table on a sub form.
I created a query using al the fields from the main table (feeds the main form) and all the fields from the second table (feeds the sub form.) doing as you outline above.

I linked the 2 tables on one field.
The fields contain the same data but have slightly different names. (SerialNumber --- CPUSerualNUm)
When I run the query, I get no results.
If a create a query with just all the fields from the first table I get all records. (over 6700 results)
The second table as structure but no data yet as I will be using the form to enter that data.
The query was created using the query wizard.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 06:08
Joined
Oct 29, 2018
Messages
21,467
Okay, that's a different question than your original post. In this case, here's what you could try.

1. Create a form for your parent/main table
2. In Design View, add a Subform Control using the Wizard
3. Select the child table for the subform and select the common/link fields for both tables
4. Open the Form and add/view records
 

Users who are viewing this thread

Top Bottom