Vertically Center Resizing Text Boxes in a Microsoft Access Report
Question details
The user needs to vertically center multiple growing or shrinking text boxes within each Access report record row, using the tallest text box as the reference.
- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- A report contains several text boxes in the same record row, and their heights vary according to their contents.
- Observed behavior
- The text boxes need to be positioned using their final rendered heights. Measuring them too early can produce incorrect alignment, while increasing their design-time heights wastes space and can add pages.
Open the report in Design View and identify the text boxes and report section that make up one record row. Check each text box's Can Grow and Can Shrink properties, and record its original Top position before adding layout logic.
Measure resized text boxes in the section's On Print event
Use the section's On Print event to inspect heights after Access has processed growth, then calculate the vertical offset needed for each control.
The key timing distinction is to measure controls in On Print rather than relying on measurements taken in On Format. Access can format a section more than once, so layout logic must tolerate repeated processing.
This approach centers the text box controls relative to the tallest control; it does not add vertical alignment to the text inside a text box. Repositioning during printing is subject to Access's layout restrictions, so verify the behavior in your report before relying on it.
In Design View, select each text box and open Property Sheet > Format. Set Can Grow to Yes where longer content must expand, and set Can Shrink to Yes where shorter or empty content should reduce the control's height. Review the containing section's resizing settings as well.
Select the section containing the record row, usually Detail. In Property Sheet > Event, set On Print to [Event Procedure], then click the build button (...) to open the VBA editor. Put the final-height measurement logic in this event rather than assuming On Format provides the grown heights.
In the section's Print event procedure, read the Height of each participating text box and find the maximum height. For controls sharing a common row origin, calculate each target position as rowTop + (maximumHeight - controlHeight) / 2. Use Access's native twip units consistently, and use a stored row origin rather than the control's previously adjusted Top value.
Apply the calculated Top positions only where Access permits the change at that event stage. Open Print Preview and test records with short, multiline, and empty values, including rows near page breaks. If Access rejects a positioning change during On Print, keep that event for measurement and revise the layout approach rather than treating the calculation as a guaranteed drop-in fix.

Create spreadsheet-based reports with WPS Office
WPS Office is a free, lightweight alternative for presenting exported Access data in spreadsheets or documents. Its familiar interface and support for common Microsoft Office formats make migration straightforward for those outputs, but it does not run Access reports or fix their VBA layout events.

Frequently Asked Questions
Why does measuring text box height in On Format give the wrong result?
On Format can run before a text box has reached its final grown height, and Access may perform multiple formatting passes. Select the report section in Design View, then use Property Sheet > Event > On Print to inspect heights after growth has been processed.
Does this vertically center the text inside each text box?
No. The calculation centers each text box control relative to the tallest control in the row. Changing a control's Top property moves the entire box; it is not the same as vertically aligning its contents.
Why not make every text box taller in Design View?
Larger fixed heights can increase the space used by every record and push the report onto additional pages. In Design View, review Property Sheet > Format > Can Grow and Can Shrink instead, then test variable-length records in Print Preview.
What if Access will not let me change Top in On Print?
Do not assume that final-height measurement also guarantees permission to reposition controls at that stage. Use On Print to inspect the rendered heights, then revise and test the report-specific positioning strategy. The supplied answer does not include a verified workaround for event-stage property restrictions.
Can WPS Office open this Access report and fix the layout?
No. WPS Office does not run Access report objects or Access VBA events. You can export the underlying data from Access to an Excel-compatible file and open it in WPS Spreadsheet to create a separate printable report.




