Toolbars

Pat
5StarLounger
Posts: 1148
Joined: 08 Feb 2010, 21:27

Toolbars

Post by Pat »

I have inherited an Access 2003 database which has toolbars that were generated by the previous developer.
Never having the need to mess around with tool bars in the past i know nothing about them, i have also lost all my Access developer books.
Can someone point me in a direction so i can learn how to create/change/delete them?

User avatar
HansV
Administrator
Posts: 78523
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Toolbars

Post by HansV »

Which version of Access are you using?

If you're using Access 2003 (or earlier), it's simple: select Tools | Customize.
In the Toolbars tab of the Customize dialog, you can select an existing toolbar and tick/clear its check box to show/hide it, or click Delete to remove it.
In the Commands tab, you can find the commands that you can add to a toolbar: select a category un the list box on the left, then a command in the list box on the right, and drag it to the toolbar where you want it.
You can move a command to a diiferent location by dragging it to the desired position on the same or another toolbar.
You can delete a command by dragging it away from the toolbar.
Right-click a toolbar button to change its properties.
To create a new toolbar, activate the Toolbars tab and click New.
Close the Customize dialog when you're done.
See Access 2003 Tutorial Creating Custom Toolbars Microsoft Training Lesson 19.2 - Video.
It is also possible to manipulate toolbars using VBA.

If you're using Access 2007, there is *no* way to manipulate custom toolbars in the Access interface. Existing custom toolbars in databases created in Access 2003 or before will be displayed in the Add-Ins tab of the ribbon.
The only way to edit/create/delete custom toolbars in Access 2007 is through VBA.
How to create command bars by using Visual Basic code in Access 2000 provides examples - since the VBA hasn't changed, it applies to Access 2007 too.
Best wishes,
Hans

Pat
5StarLounger
Posts: 1148
Joined: 08 Feb 2010, 21:27

Re: Toolbars

Post by Pat »

Thnak you Hans, that's quite a tutorial there. It is Access 2003.

Is a menu bar the same as a tool bar?

User avatar
HansV
Administrator
Posts: 78523
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Toolbars

Post by HansV »

Yes, a menu bar is a special type of toolbar. There are three types:
Normal = toolbar
MenuBar
Popup = right-click menu
Best wishes,
Hans

Pat
5StarLounger
Posts: 1148
Joined: 08 Feb 2010, 21:27

Re: Toolbars

Post by Pat »

Thanks, i take it that a menu bar is displayed vertically.
When the database is opened without the shift key a menu bar is displayed with 4 items on it.
How can i see what is behind each of these items, eg is a macro or vba code running behind it?

User avatar
HansV
Administrator
Posts: 78523
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Toolbars

Post by HansV »

As with all toolbars, you can move and resize a menu bar.

Select Tools | Customize...
Right-click the item/button you're interested in.
Select Properties from the popup menu.
You'll see various properties of the item/button.
The OnAction property specifies what the item/button does when clicked.
Best wishes,
Hans