Create an AutoLookup query

For AutoLookup to work on new records, certain conditions must be met.

For AutoLookup to work, certain conditions must be met:

  1. Create a select query, adding two tables that have a one-to-many relationship.

    How?

    1. In the Database window, click Queries under Objects, and then click New on the Database window toolbar.
    2. In the New Query dialog box, click Design View, and then click OK.
    3. In the Show Table dialog box, click the tab that lists the tables or queries whose data you want to work with.
    4. Double-click the name of each object you want to add to the query, and then click Close.
    5. Add fields to the Field row in the design grid, and if you want, specify criteria and a sort order.
    6. To view the query's results, click View on the toolbar.
  2. Add the fields for the query to the design grid.

    You must include the join field from the "many" side of the one-to-many relationship.

    Include the join field from the "many" table

    1  Use the join field ...

    2  ... from the "many" table.

  3. To retrieve specific records, specify criteria in the Criteria row.

    How?

    1. Open a query in Design view, or display the Advanced Filter/Sort window for a table, query, or form.
    2. Click the first Criteria cell for the field you want to set criteria for.
    3. Enter the criteria expression by typing it or by using the Expression Builder. To display the Expression Builder, right-click the Criteria cell, and then click Build.

      Records retrieved meet the criteria in both columns

      1  Retrieves orders shipped to Bon App' on 8/11/2001.

      If your query includes linked tables, the values you specify in criteria on fields from the linked tables are case-sensitive รน they must match the case of the values in the underlying table.

    4. To enter another expression in the same field or in another field, move to the appropriate Criteria cell and enter the expression.
  4. To view the query's results, click View on the toolbar.

    When you enter new data in the join field on the "many" side of the relationship, Microsoft Access will automatically look up and fill in the corresponding data from the "one" side.