Assign the Unhide Columns Command to an Access Form Button
Question details
The user wants an Access form button to open the dialog for unhiding columns.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- A form contains a button intended to simplify unhiding fields in a table or subform datasheet.
- Observed behavior
- The button should open the Unhide Fields or Unhide Columns dialog for the active datasheet.
Open the Access database and identify the table or subform datasheet whose columns you want to unhide. Confirm that the form has a command button, or add one in Design View.
Attach an Unhide Columns macro to the form button
Use the button's On Click event to run the same command that opens the unhide dialog from the Ribbon.
Open the form in Design View, select the command button, and open its Property Sheet.
On the Event tab, select the On Click property and use the ellipsis button to open Macro Builder. Choose Macro Builder if Access asks which builder to use.
Add the RunMenuCommand action, then select Unhide Columns in its Command setting. The command may appear as UnhideColumns in the list.
Save the macro and form, switch to Form View, and click the button while the intended datasheet is active. In the dialog, select the columns to show.

Work with spreadsheet columns in WPS Office
For spreadsheet work, WPS Office is a free, lightweight alternative with a familiar interface and support for common Office formats, making it easy to move existing files. It does not replace Access form buttons or run Access macros.

Frequently Asked Questions
Which macro action opens the Unhide Columns dialog in Access?
In Macro Builder, add RunMenuCommand and select Unhide Columns, which may be listed as UnhideColumns, in the Command setting.
How do I attach the macro to a form button?
Open the form in Design View, select the button, and use the On Click property on the Property Sheet's Event tab to create or assign the macro.
Why is the Unhide Columns command unavailable from my button?
The command requires an appropriate datasheet context. Check that the intended table or subform datasheet is active when the macro runs.
Can VBA show a specific subform column instead of opening the dialog?
Yes. For a subform datasheet column, VBA can set its ColumnHidden property to False, for example: Me.SubformName.Form!ColumnName.ColumnHidden = False. Replace the names with your subform control and column names.




