The following table lists examples of expressions that combine two or more values to return a string.
You can use these expressions in calculated controls (calculated control: A control that is used on a form, report, or data access page to display the result of an expression. The result is recalculated each time there is a change in any of the values on which the expression is based.) on forms, reports, and data access pages (data access page: A Web page, published from Access, that has a connection to a database. In a data access page, you can view, add to, edit, and manipulate the data stored in the database. A page can also include data from other sources, such as Excel.).
| Expression |
Description |
| =[FirstName]&" "&[LastName] |
Displays the values of the FirstName and LastName fields, separated by a space. |
| ="Today's date is "&Date() |
Displays "Today's date is 12/31/2003" if the current date is 12/31/2003. |
| ="Total number of items: "&[Total] |
Displays "Total number of items: 10" if the Total field contains the value 10. |
| ="Option "&[Counter]&" is selected" |
Displays "Option 3 is selected" if the Counter field has the value 3. |
You can use these expressions in a calculated field in a query.
| Expression |
Description |
| FullName: [FirstName] & " " & [LastName] |
Displays in the FullName field the value of the FirstName and LastName fields, separated by a space |
| MyDate: "Today's date is "&Date() |
Displays in the MyDate field the string "Today's date is 12/31/2003" if the current date is 12/31/2003. |
| TotalLine: "Total number of items: "&[Total] |
Displays in the TotalLine field the string "Total number of items: 10," if the Total field contains the value 10. |