DLookUp, Access Expression Builder
This article will explain the DLookUp function used in the Access expression builder.
The field whose value will be returned. String expression.
The set of records where the value will be retrieved from. String expression.
The criteria which will be used to get the value from. String expression.
This example will use the same table as the previous examples but will use the form below. This form has 2 textboxes:
The user inputs the ID of a student in the first text box. We want an expression that will print the first name of the student associated with the ID in the first text box in the second text box. In this example the first text box has the name txtName:
The following expression should be used as the Control Source for the second text box:
expression returns the value in the textbox
. The expression
converts it to a string and concatenates it to the rest of the criterion expression.
You can download the sample file used in this article from the link below: