Others

Hide Null Fields and Labels in an Access 2016 Report

Huda QurayshiHuda Qurayshi Nov 25, 2026 868 views

Question details

Hide a null field and its associated label in an Access 2016 report and reduce the resulting blank space.

Hide Null Fields and Labels in an Access 2016 Report
Product
Microsoft Access 2016
Device & OS
not provided
Scenario
A report contains vertically arranged fields, some of which may be null for a given record.
Observed behavior
The desired report shows neither the text box nor its label when the field is null, with unused vertical space reduced where possible.
Before you start

Open the report in Design View and identify the text box and label names on the Other tab of the Property Sheet. The text box should be bound to the field you want to check.

Solution 1Recommended

Use the Detail section's Format event to hide empty controls

Use VBA to hide both the text box and label for null values, then enable shrinking to reduce unused space.

The Format event runs when Access formats the report for printing or Print Preview. The code also makes the controls visible again for records where the field is not null.

1
Open the report properties

In the Navigation Pane, right-click the report and select Design View. Select the text box and open the Property Sheet if it is not already visible.

2
Allow the layout to shrink

On the text box's Format tab in the Property Sheet, set Can Shrink to Yes. Select the Detail section and set its Can Shrink property to Yes as well.

3
Create a Format event

Select the Detail section, open the Event tab in its Property Sheet, and click the Build button (…) next to On Format. Choose Code Builder if prompted.

4
Add the visibility code

Between the existing procedure lines, enter: If IsNull(Me.txtSomeField) Then Me.txtSomeField.Visible = False Me.lblSomeLabel.Visible = False Else Me.txtSomeField.Visible = True Me.lblSomeLabel.Visible = True End If Replace txtSomeField and lblSomeLabel with the actual control names from the Property Sheet.

5
Preview the report

Save the report, then open Print Preview and check records with and without a value. Adjust the vertical layout if other controls prevent the section from shrinking.

Use the Detail section's Format event to hide empty controls
Check in Print Preview: Report View may not apply the Format event in the same way. Can Shrink reduces space where the layout permits it; controls that occupy the same vertical area can limit shrinking.
Free Microsoft Office alternative

Work with Office Documents in WPS Office

WPS Office is a free, lightweight alternative with a familiar interface for working with compatible Office documents. Open existing files to make migration easier; it does not replace Access or fix Access report formatting.

Edit documents, spreadsheets, and presentations in a familiar interfaceOpen and work with Microsoft Office formats such as DOCX, XLSX, and PPTXUse spreadsheets to organize data alongside your Access reporting workflowMove existing compatible Office files into a lightweight office suite
microsoft office alternative - wps office

Frequently Asked Questions

Where do I find the text box and label names?

Open the report in Design View, select each control, and check the Name property on the Other tab of the Property Sheet. Use those names in the VBA code.

Will Can Shrink hide the label automatically?

No. Can Shrink can reduce unused space, but the label's visibility must be controlled separately, such as with the Detail section's On Format event.

Why are the controls still visible in Report View?

The Detail section's Format event is intended for formatting the report for printing and may not run the same way in Report View. Check the result in Print Preview.

Why is there still a blank gap after hiding a field?

In Design View, check that Can Shrink is set to Yes for both the text box and the Detail section. Other controls occupying the same vertical area can also prevent the section from shrinking.