Share via

VBA code - Show/Hide Ribbon

Anonymous
2018-03-31T15:22:06+00:00

I have recently updated an Access database to Access 2016. In the previous version (2003 mdb) I had some VBA code that showed or hid the menus/toolbars on request from a command button. Does anyone have some code that would do the same for the Ribbon in Access 2016?

Thanks.

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

2 answers

Sort by: Most helpful
  1. Anonymous
    2018-03-31T16:27:54+00:00

    There are different ways to do this.  Personally, i like to create a USysRibbons table and create a blank ribbon and set it as the application ribbon.  This way (i) i can easy hide the default ribbon, (ii) i can create my own custom ribbons for my applications (for printing, exporting, ...).

    Using vba you could do

    DoCmd.ShowToolbar "Ribbon", acToolbarNo

    Then to show it again you'd do

    DoCmd.ShowToolbar "Ribbon", acToolbarYes

    Was this answer helpful?

    10+ people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2018-04-01T08:31:15+00:00

    There are different ways to do this.  Personally, i like to create a USysRibbons table and create a blank ribbon and set it as the application ribbon.  This way (i) i can easy hide the default ribbon, (ii) i can create my own custom ribbons for my applications (for printing, exporting, ...).

    Using vba you could do

    DoCmd.ShowToolbar "Ribbon", acToolbarNo

    Then to show it again you'd do

    DoCmd.ShowToolbar "Ribbon", acToolbarYes

    Thank you. That works perfectly.

    Was this answer helpful?

    10+ people found this answer helpful.
    0 comments No comments