Resize Text for Long Names in Microsoft Access Reports
Question details
The user wants long names in a fixed-width Access report text box to use a smaller font so they can fit on one line.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- A report displays names of varying lengths in a fixed-width text box.
- Observed behavior
- Long names do not fit in the text box, and the Can Grow property expands the control vertically rather than shrinking its font.
Open the report in Design View and identify the name of the text box that displays the names. Decide which font sizes and character-length threshold you want to test.
Change the text box font size in the Detail Format event
Use a VBA event procedure to apply a smaller font to names above a chosen length.
This approach changes the font size based on character count, not the actual rendered width. Adjust the threshold and sizes after testing representative names.
In the Navigation Pane, right-click the report and select Design View. Select the Detail section, open the Property Sheet, and choose the Event tab.
Set On Format to [Event Procedure], then click the ellipsis button to open the VBA editor.
In the Detail_Format procedure, add the following code, replacing txtName with the actual text box control name: Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer) If Len(Nz(Me!txtName.Value, "")) > 5 Then Me!txtName.FontSize = 6 Else Me!txtName.FontSize = 8 End If End Sub
Save the report and open it in Print Preview. Check short and long names, then return to the VBA editor to adjust the threshold or font sizes as needed.

Create Documents and Spreadsheets with WPS Office
WPS Office is a free, lightweight Office alternative with a familiar interface and Microsoft Office format compatibility for an easier transition. It does not run Microsoft Access report events or replace this Access-specific fix.

Frequently Asked Questions
Does Can Grow make the font smaller in an Access report?
No. Set Can Grow in the text box Property Sheet to allow the control to expand vertically; it does not automatically reduce the font size.
Where do I find the Detail section's Format event?
Open the report in Design View, select the Detail section, and open Property Sheet > Event. Set On Format to [Event Procedure] and click the ellipsis to edit the VBA.
Why does the font size stay the same in Report View?
The Format event does not run in Report View. Save the report and use Print Preview to test the event procedure.
Will a character-count threshold make every name fit?
Not necessarily. Characters have different widths, so test names in Print Preview and adjust the threshold, font size, or text box width as needed.




