The Expression Builder does just that—allows you to build an expression with the various fields and controls in your database. For example, in response to the click event of a command button, you can populate a text box on your form with the name of a particular product from the Products table. To build your expression, double-click the Tables branch of the tree in the bottom-left pane of the Expression Builder. Choose the Products table and all of the fields from that table appear in the middle pane of the Expression Builder. Double-click the ProductName field. You can perform a conditional and comparison operations within the Expression Builder as well. For example, you could enter the following in the Expression Builder:
=MsgBox("Enter a Product ID between 1 and 10")
This code displays a message box informing the user what sort of data to enter in a text box. You can put this code in one of the events of the txtProductID text box. There are a variety of types of expressions
you can build. Access includes a variety of built in functions you can use within the Expression Builder, including mathematical functions, financial functions, and text comparison functions.
Was this article helpful?