Fix DLookup Returning #Error in a Microsoft Access Report
Question details
Fix a DLookup expression that returns #Error in an Access report when its record source uses joined tables.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- A report looks up a financial impact description using a value from its record source.
- Observed behavior
- The lookup works with a table record source but displays #Error when the report uses a query containing joined tables.
Open the report in Design View and identify the text box containing the DLookup expression. Check that the report's Record Source includes the financial impact field and that FinancialImp contains the FinValue and FinString fields.
Build an explicit numeric DLookup criterion
Use this expression when FinValue and the report's financial impact value are numeric.
In Access, right-click the report in the Navigation Pane, choose Design View, and select the text box displaying #Error. Open its Property Sheet and select the Data tab.
In Control Source, enter: =DLookUp("[FinString]","[FinancialImp]","[FinValue] = " & [ttFinancial Impact]). This inserts the current report value into the numeric criteria string.
Open the report's Record Source query in Datasheet View and verify that [ttFinancial Impact] is present, numeric, and populated for the rows you are testing. If its name is ambiguous, give the query field a unique alias and use that alias in the expression.
Save the report and switch to Report View or Print Preview. Check several records to confirm that the expected FinString values appear.

Resolve ambiguous fields in the joined record source
Use this check if the joined query contains similarly named fields or the expression still returns #Error.
Work with exported Access data in WPS Spreadsheets
WPS Office is a free, lightweight Office alternative with a familiar interface. Export Access query results to Excel to work with the data in WPS Spreadsheets; WPS does not run Access reports or fix Access DLookup expressions.

Frequently Asked Questions
Why does DLookup work with a table but fail with a joined query?
The joined query may expose an ambiguous field name, omit the field the report expects, or return a different value than intended. Open the report's Record Source in Query Design, check the output fields, and give the lookup value a unique alias.
What happens when DLookup finds no matching record?
DLookup returns Null when no record matches the criterion. Check that the report value matches a FinValue in FinancialImp and distinguish a missing match from an invalid expression that displays #Error.
Does the DLookup criterion change for a text field?
Yes. Text values must be enclosed in quotes within the criteria string, unlike the numeric example. Any quote characters in the value must also be escaped so the criterion remains valid.
Where do I enter the expression in an Access report?
Open the report in Design View, select the result text box, and enter the expression in Property Sheet > Data > Control Source. An expression entered there begins with an equals sign.




