Change an Access Form Detail Section Height with VBA
Question details
The user needs to change the height of an Access form's Detail section from a subform and understand why the visible form size does not change.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- A subform runs VBA that changes the Detail section height of a pop-up form.
- Observed behavior
- The Detail section height changes, but the pop-up form window remains the same size and the change may not be visible.
Open the pop-up form and confirm its name in the Navigation Pane. In the VBA editor, press Ctrl+G to open the Immediate window so you can check the section height while the form is open.
Verify the Detail section height and check scroll bars
Use this approach to confirm that the VBA property changed and make content accessible when the section extends beyond the visible form area.
Section(0) refers to the Detail section. Its Height property is measured in twips and does not control the overall pop-up window size.
In the subform's VBA procedure, use Forms![frm_BusinessContact].Section(0).Height = 2300, replacing frm_BusinessContact with the name of your open pop-up form.
In the VBA editor, press Ctrl+G and enter ?Forms![frm_BusinessContact].Section(0).Height in the Immediate window. Press Enter to display the current height in twips.
Open the form in Design View, select the form using the selector at its upper-left corner, and open the Property Sheet. On the Format tab, check the Scroll Bars property and choose Vertical or Both if users need to scroll through the form.
Open the form in Form View, run the subform's VBA action, and use the vertical scroll bar if the changed Detail section extends beyond the visible area.

Resize the Access pop-up form window separately
Use this when the Detail section height is correct but the pop-up window itself needs to be larger or smaller.
Use WPS Office for everyday Office documents
WPS Office is a free, lightweight alternative for documents, spreadsheets, and presentations. Its familiar interface and Microsoft Office format compatibility make it easy to move everyday files. Microsoft Access is still required to edit Access forms or run their VBA code.

Frequently Asked Questions
Why doesn't changing Section(0).Height resize my Access form?
Section(0).Height changes the Detail section, not the form window. To resize the active pop-up window, activate the form and use DoCmd.MoveSize with the desired width and height.
How can I confirm that the VBA code changed the Detail section height?
With the form open, press Ctrl+G in the VBA editor and enter ?Forms![frm_BusinessContact].Section(0).Height in the Immediate window. Replace the form name and press Enter to see the value in twips.
Where can I enable scroll bars on the form?
Open the form in Design View, select the form, and open the Property Sheet. On the Format tab, set Scroll Bars to Vertical or Both, then test the form in Form View.
Can WPS Office edit an Access form or run its VBA code?
No. Use Microsoft Access to edit the form and run its VBA code. WPS Office can be used separately for compatible documents, spreadsheets, and presentations.




