I
Insight Horizon Media

How do I use the dlookup function in access?

Author

Sarah Cherry

Published Feb 18, 2026

How do I use the dlookup function in access?

Use the DLookup function in a Visual Basic for Applications (VBA) module, a macro, a query expression, or a calculated control on a form or report. Note: This article doesn’t apply to Access web apps. You can use the DLookup function to display the value of a field that isn’t in the record source for your form or report.

How to get a unique field from dlookup function?

If more than one record matches the criteria, then in that case DLookup will return the first instance of that . So, criteria should be defined carefully in order to get a unique field from the DLookup function. If your criteria filed is text then keep that text in single quotation marks.

How do I use dlookup in a calculated control?

You can also use the DLookup function in an expression in a calculated control on a form or report if the field that you need to display isn’t in the record source on which your form or report is based.

How to use dlookup() function in txtme?

Me.txtUserName = DLookup (“ [User Name]”, “tblUser”, “ [User Name] = ‘john’”) Well, it is the simplest way to use DLookup () function; i.e without specifying any criteria. In this case, the DLookup function will give you the value of the first record in the CustomerName field from tbl_Customer table.

Is dlookup slow on a larger table?

Yea I realize that DLookUp is usually slow but when I run the dlookup query on a different table, larger table it runs alot faster. – Egryan

What happens if criteria is not included in dlookup?

If criteria is omitted, the DLookup function evaluates expr against the entire domain. Any field that is included in criteria must also be a field in domain; otherwise, the DLookup function returns a Null. The DLookup function returns a single field value based on the information specified in criteria.

How do I change the default record locking in access 2016?

Click File > Options to open the Access Options dialog box. In the left pane, click Client Settings. In the right pane, in the Advanced section, under Default record locking, click the option that you want.