| the Manx Man's MS Access Pages
Creating and Using a Custom Toolbar (018)
Creating a custom toolbar is easy.
- Click on the View menu
- Click on the Toolbars item, Customize item
- Click on New and give it a name, then click OK
Notice that Access creates a small, empty, toolbar. Mine was a bit in the
way, so I dragged it off to the side a bit.
- Click on the Commands tab.
- Find each command that you want on your toolbar and drag it on to the toolbar.
- When you are done, leave it floating, or drag up to the traditional toolbar area of the
screen and have it docked.
One tip. It took me a bit to figure this out. How do you get the little
vertical bars that separate groups of buttons? Click on the "Modify Selection"
button and click on the "Begin a New Group" item. You will find other things
under that button.
Next - How can we make that toolbar appear and disappear while in your program?
For example, many of my clients have systems that have no toolbars showing for some users.
Just the buttons on the forms. However, when in a query or in print preview mode, how do
you command a Close, other than by using the "x"? By making a custom toolbar and
making it show up only when needed.
This code should turn off the normal toolbar.
Dim oldMBar As Variant
Set oldMBar = CommandBars.ActiveMenuBar
oldMBar.Enabled = False
To turn on your custom toolbar:
DoCmd.ShowToolbar "name of toolbar", acToolbarYes
and to turn it off
DoCmd.ShowToolbar "name of toolbar", acToolbarNo
|