Relate Imported Excel Data to an Access Contacts Table
Question details
Connect imported Excel teaching records to the correct contacts in Microsoft Access.

- Product
- Microsoft Access and Microsoft Excel
- Device & OS
- not provided
- Scenario
- An Excel worksheet lists instructors and the units they teach, while an Access table stores their contact records.
- Observed behavior
- Each teaching record should reference a unique contact ID so a query can display the units taught by each instructor.
Check whether the Excel worksheet and Contacts table share a unique employee or instructor identifier. If they do not, identify additional information you can use to verify matches, because names alone may not be unique.
Import the Excel data and link teaching records by contact ID
Use this approach to create a reliable one-to-many relationship between contacts and their teaching records.
Open the Contacts table in Design View and confirm that ContactID is its primary key. If no suitable unique key exists, add a ContactID field with the AutoNumber data type, select the field, and click Primary Key.
In Access, select External Data > New Data Source > From File > Excel. Choose the workbook and import the worksheet into a new temporary table, using the first row as column headings if it contains field names.
Select Create > Table Design and create a UnitsTaught table with its own primary key, a ContactID foreign-key field, and the unit information you need. If Contacts.ContactID is an AutoNumber field, set UnitsTaught.ContactID to Number with Field Size set to Long Integer.
Use Create > Query Design to match the temporary table to Contacts by a shared unique identifier. If no identifier is shared, build a mapping table from the source instructor identifier to ContactID and verify ambiguous or unmatched records manually. Create an Append query to add each verified ContactID and unit record to UnitsTaught.
Open Database Tools > Relationships, add Contacts and UnitsTaught, and drag Contacts.ContactID onto UnitsTaught.ContactID. Select Enforce Referential Integrity and click Create.
Select Create > Query Design, add Contacts and UnitsTaught, and include the contact name and unit fields. Run the query to display each instructor's teaching records.
Prepare Excel Teaching Data with WPS Office
WPS Office is a free, lightweight alternative with a familiar interface for reviewing and organizing spreadsheet data before importing it into Access. Its Excel format support helps you move existing worksheets without starting over. Access is still needed to create and enforce the database relationship.

Frequently Asked Questions
Why shouldn't I relate the tables using instructor names?
Names can be duplicated or changed, which can link a teaching record to the wrong contact. Use a unique ContactID or EmployeeID as the primary key in Contacts and store that ID as a foreign key in UnitsTaught.
What if the Excel file does not contain a contact ID?
Import it into a temporary table using External Data > New Data Source > From File > Excel. Create a mapping from each source instructor identifier to the correct ContactID, and manually verify ambiguous or unmatched records before appending them.
What data type should the foreign key use?
It must be compatible with the Contacts primary key. If ContactID is an AutoNumber field, set the related ContactID field in UnitsTaught to Number with Field Size set to Long Integer.
How do I show the units taught by each instructor?
Select Create > Query Design, add the related Contacts and UnitsTaught tables, and add the contact name and unit fields to the query grid. Run the query to see the matching records.
Can WPS Office create the Access relationship?
WPS Spreadsheets can help you review and edit the Excel source file, but it does not create or enforce Microsoft Access table relationships. Use Database Tools > Relationships in Access for that step.




