How to Add Variable Text to an Access Report Using Controls
Question details
The user wants to display variable or dynamic text, such as customer name, project, and email, in a Microsoft Access report entry without relying on labels or VBA paint events.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- Customizing a database report to include personalized or dynamic text paragraphs based on record data.
- Observed behavior
- The user needs a method to seamlessly concatenate static text with dynamic database fields within the report entries without writing code.
Ensure you have the necessary tables or queries set up in your Access database containing the customer, project, and contact information you want to display.
Use Text Box Control Sources with Concatenation
The most efficient way to add variable text without VBA is by using a query as the record source and text boxes with concatenated expressions.
Instead of using VBA or rigid labels, you can leverage Microsoft Access's built-in expression builder. By creating a query that pulls all your necessary fields, you can use standard text boxes to join (concatenate) static text and dynamic data.
Create a query that includes all the required fields (e.g., Customer, ProjectName, EmailAddress). Save this query and set it as the Record Source for your report.
Open your report in Design View. Insert a new Text Box control into the desired section (like the Detail section) and delete the attached label if it is not needed.
Select the Text Box, open the Property Sheet, and type an expression in the Control Source property using the ampersand (&) operator to concatenate text and fields. For example: ="Dear " & [Customer] & ":"
For longer dynamic sentences, use the same syntax to weave fields into the text. Example: ="Are you still working on " & [ProjectName] & "? If so, please contact " & [EmailAddress] & " with the current status."

Discover WPS Office for Your Document Needs
While Microsoft Access is used for complex databases, you can manage your exported reports, data tables, and daily documentation effortlessly with WPS Office. It provides a lightweight, free alternative to the Microsoft Office suite.

Frequently Asked Questions
Can I format specific words inside the concatenated text box?
No, standard Access text boxes apply formatting to the entire control. If you need rich text formatting for specific words (like making only the customer name bold), you must set the text box's Text Format property to Rich Text and use HTML tags within your expression.
Why is my text box displaying a #Name? error?
The #Name error occurs if the field names referenced in your expression (like [Customer] or [ProjectName]) do not exist in the report's underlying Record Source. Verify that your query includes all necessary columns and that they are spelled correctly.
Do I need to use VBA paint events to display dynamic text?
No, using Control Source expressions with the ampersand (&) operator is a built-in, code-free alternative that dynamically updates text for each record without requiring VBA programming.




