Others

Replace Microsoft Access DLookup with a Faster Query Join

Tauseeq MagsiTauseeq Magsi Nov 14, 2026 869 views

Question details

Improve query performance by replacing a DLookup expression with a SQL join.

Replace Microsoft Access DLookup with a Faster Query Join
Product
Microsoft Access
Device & OS
not provided
Scenario
An Access query retrieves employee salary records and looks up a Paye value from another query.
Observed behavior
The query is slow when DLookup is evaluated for result rows.
Before you start

Check the existing DLookup criteria and confirm which fields identify the correct salary record. Verify that the corresponding join fields have compatible data types and that the lookup query returns at most one intended match per record.

Solution 1Recommended

Replace DLookup with an Access SQL join

Use a join to retrieve the Paye value directly instead of evaluating DLookup for each result row.

1
Open the query in SQL View

In Access, right-click the query in the Navigation Pane and select Design View. Then choose View > SQL View.

2
Replace the lookup with a join

Adapt the query to join the salary queries directly. For example: SELECT QryMonzeSalaries.EmployeeID, QryMonzeSalaries.NapsaFinal, QryMagoyeSalary.Paye AS PayeFin FROM QryMonzeSalaries INNER JOIN QryMagoyeSalary ON QryMagoyeSalary.ZZDone = QryMonzeSalaries.Mnths;

3
Check the matching criteria

Compare the ON clause with the original DLookup criteria. If Paye is employee-specific and both queries expose EmployeeID, add an EmployeeID equality condition to the join so records are matched by employee as well as month.

4
Index and test the query

Open the underlying tables in Design View and consider indexing the fields used in the join. Run the query with the Run button, then compare its results and execution time with the original.

Replace DLookup with an Access SQL join
Check unmatched and duplicate records: INNER JOIN excludes rows without a match. If those rows must remain, use LEFT JOIN with QryMonzeSalaries on the left. Multiple matching rows can duplicate results, so make sure the join criteria identify the intended record.
Free Microsoft Office alternative

Review exported salary data with WPS Spreadsheets

WPS Office is a free, lightweight alternative for working with exported salary data in a familiar spreadsheet interface. Its Microsoft Excel format compatibility makes it easy to move spreadsheet files between suites. It does not replace Access or fix Access query performance.

Review and filter salary data exported from AccessOpen and edit Microsoft Excel formats such as XLSXUse a familiar spreadsheet interface for an easier transitionWork with a free, lightweight office suite
microsoft office alternative - wps office

Frequently Asked Questions

Why can a join be faster than DLookup?

DLookup may be evaluated repeatedly for result rows. A join lets Access retrieve matching data as part of the query, although performance still depends on the data, indexes, and query design.

Should EmployeeID be included in the join?

Include EmployeeID when the Paye value is specific to an employee and the field is available in both queries. Match the join conditions to the original lookup criteria and the intended business rules.

How can I keep salary records that have no matching Paye value?

Use a LEFT JOIN with QryMonzeSalaries on the left. Unmatched salary rows remain in the result, with a null value for PayeFin.

Where should I add indexes if I am joining two queries?

Open the underlying tables in Design View and consider indexes on the fields used for matching, such as the month and employee fields. Queries themselves do not store indexes.

Why did the join return more rows than DLookup?

A join returns every matching row. Check the lookup query for duplicate matches and add the necessary join conditions or resolve duplicate source records.