Examples of manipulating text values in forms, reports, and data access pages

Examples of manipulating text values in forms, reports, and data access pages

The following table lists examples of expressions that you can use in calculated controls on forms, reports, and data access pages.

Expression Description
="N/A" Displays N/A.
=[FirstName] & " " & [LastName] Displays the values of the FirstName and LastName fields separated by a space.
=Left([ProductName], 1) Uses the Left function to display the first character of the value of the ProductName field.
=Right([AssetCode], 2) Uses the Right function to display the last 2 characters of the value of the AssetCode field.
=Trim([Address]) Uses the Trim function to display the value of the Address field, removing any leading or trailing spaces.
=IIf(IsNull([Region]), [City] & " " & [PostalCode], [City] & " " & [Region] & " " & [PostalCode]) Uses the IIf function to display the values of the City and PostalCode fields if Region is Null; otherwise, it displays the values of the City, Region, and PostalCode fields, separated by spaces.

Notes