The information in this article applies to:
SUMMARY
Moderate: Requires basic macro, coding, and interoperability skills.
MORE INFORMATIONDLookup() FunctionThe syntax for the DLookup() function is a follows:
The DLookup() function returns a value from a field in a specified set of records called the domain. The DLookup() function specifies the criteria for the domain. To make the domain dependent on one or more values listed in controls on a form or report, refer to the controls in the DLookup() criteria argument. The following example looks in the Employees table (the domain) and returns the Last Name of the Employee ID specified in the [ControlName] control on the Form. In Microsoft Access 7.0 and 97
In Microsoft Access 1.x and 2.0NOTE: In the following sample code, an underscore (_) is used as a line- continuation character. Remove the underscore from the end of the line when re-creating this code in Access Basic.
For reports, use Reports![ReportName]![ControlName]. DLookup() returns one value from a single field even if more than one record satisfies the criteria. If no record satisfies the criteria or if the domain contains no records, DLookup() returns Null. REFERENCESFor more information about the DLookup() function, search the Help Index for "DLookup," or ask the Microsoft Access 97 Office Assistant. Additional query words: functions
Keywords : kbusage FmsHowto |
Last Reviewed: March 12, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |