The DLookup function can be used in VBA code in Microsoft Access.
Dim varX As Variant varX = DLookup("", "Shippers", " = 1") The criteria argument restricts the resulting set of records to those for which ShipperID equals 1. The following example returns name information from the CompanyName field of the record satisfying criteria.The domain is a Shippers table.
DLOOKUP EXCEL VBA EXAMPLES FULL