Applies ToAccess for Microsoft 365 Access 2024 Access 2021 Access 2019 Access 2016
Your browser does not support video. Install Microsoft Silverlight, Adobe Flash Player, or Internet Explorer 9.

Try it!

The Lookup Wizard establishes a relationship between tables. It creates a foreign key that refers back to the primary key of another.

Create a relationship with the Lookup Wizard

  1. In Datasheet View, open the table that will look up data from another table. This is your child table.

  2. In the rightmost column, select Click to Add and then select Lookup & Relationship.

    Add a new table column, type "Lookup and Relationship"
  3. In the Lookup Wizard, select I want the lookup field to get the values from another table or query. Then, select Next.

  4. Select the table that will provide the values for your lookup field. This is your parent table. Then, select Next.

  5. To select the fields that you want to pull data from, set the sort order for the fields, and set the column width, follow the instructions on the page.

    When you set the column width, to reduce visual clutter in the table, select Hide Key Column. It won’t affect the relationship or data syncing between the tables.

  6. Select a field that uniquely identifies rows in the parent table.

  7. Enter the name for your new lookup field, select Enable data integrity, and then select either Cascade Delete or Restrict Delete.

    Name the field in a way that is reflective of the data, and note that it’s a foreign key field, for example, Customer IDFK.

  8. Select Finish, and then select Save Save.

You’ve created a relationship and a foreign key and specified data-syncing parameters between the two tables.

Change a relationship between tables

If you want to change the table relationship, first close the tables.

  1. Select Database Tools > Relationships.

  2. Select the relationship line between the two tables.

    A one-to-many relationship
  3. Select Design > Edit Relationships.

  4. In the Edit Relationships dialog box, make your changes and then select OK.

  5. To save your changes, select Save Save.

Want more?

Create, edit or delete a relationship

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.