Flylib.com

Books Software

 
 
 

Further Reading


Further Reading

As you can expect, there is never enough information when it comes to powerful products like Access. To assist you with further investigations, I have put together a Web page with hyperlinks to Web sites and articles on the issues relating to material in this chapter, including

  • Tuning Up Your Design Toolbars in Access 2000/97

  • All About Command Bars: Menu Bars, Toolbars, and Shortcut Menus

  • Command Bars in Access 97

You can find the further reading Web page for this chapter in the Downloads section of the Apress Web site ( http://www.apress.com ) or at the address http://www.vb123.com/map/too.htm .

Now I will introduce some additional VBA code samples that are included in the downloadable database.

Additional Toolbar Programming

The CommandBar object is a powerful tool that has many properties and methods that you can learn. In the download database, I have provided VBA code samples in the form called frmShowMenus (see Figure 7-22) that will:

  1. Show you how to list all the commands in a shortcut/pop-up menu.

  2. Find all the custom menus in your database and display them in a separate list box for each toolbar type. You can easily turn off the custom toolbar filter and use the same form to list the built-in toolbars and menus as well.

click to expand
Figure 7-22: - Additional toolbar VBA code in the frmShowMenus form.

Runtime Menus

Another way to restrict the menu items in an Access database to those that are essential for forms and reports is to use the Access runtime options. You can bring up the runtime environment in two ways:

  1. Include the /Runtime option in an Access shortcut file (explained in Chapter 10).

  2. Install the runtime environment on a computer that doesn't have Access installed. This packaging system is available if you purchase the Office Developer edition of Access.

The menus displayed are the same as those if you clear the Allow Full Menus startup check box. It is necessary to have a startup form before starting Access in runtime mode. You can read more about runtime systems in Chapter 12.

Managing Menus Across Multiple Databases

To use the same menus across multiple databases, I recommend that you keep all your standard menus in one library database and give the menus a name (prefix/suffix) that identifies them as coming from that database. Then, if you need the menus, import them into your current database to install them. If you make any enhancements to the menus, do so in the library database. If you decide to customize the default characteristics of the custom menu, you will need to rename it so that you know that it is now specific to the current database.



Reflecting on this Chapter

Access is a multifaceted interface designed for both developers and users. Nowhere is that more apparent than in the toolbars and menus part of the user interface. Like other parts of the Access environment, this flexibility means that there are a lot of holes to plug to protect your database. This chapter should have provided you with the skill and knowledge to help you in that regard by discussing these relevant issues:

  • How to build custom toolbars, menus, and shortcut menus.

  • How to add VBA code to the custom toolbars.

  • How to use VBA to change the relevant properties in your forms so that they use your custom toolbars and shortcut menus.

  • What the toolbar related startup options are, how they work, and how custom menus are an important part of that mechanism.

  • How to disable developer-specific toolbar commands on end-user computers.

Of course, this seems like a lot of material, but I can assure you that though toolbars and menus seem a little tricky at first, they really are quite easy to set up. As a first step, you should ensure that the developer-specific commands are not available to the end user, because this precaution will better protect your database and make it easier for your users.