Friday, January 19, 2018

Make a database easier to use by customizing and controlling the Navigation Pane

Make a database easier to use by customizing and controlling the Navigation Pane

You can improve the usability of a database by customizing and controlling the contents and organization of the Navigation Pane. Custom navigation can help improve efficiency by grouping, highlighting, or hiding objects. This article documents ways that you can customize and control the Navigation Pane to improve usability by making it easier for users to find just the database objects they need to use.

This article does not document database security features, such as encrypting a database with a password. For more information, refer to the See Also section.

In this article

Overview

Before you begin

Customize the Navigation Pane

Control the Navigation Pane by using a macro

Disable Design view for an item

Hide a database object

Overview

Located along the side of the screen, the Navigation Pane provides an interface for the objects in your database, and provides several features that help you to customize the user experience.

Objects in the Navigation Pane

In the Navigation Pane, items are arranged into groups. You choose how to group the items by specifying a category, such as Object Type or Created Date. The preceding illustration depicts the All Access Objects group of the Object Type category, with some of the object type groups, such as Tables and Queries, closed.

Custom categories and groups

You can also create custom categories, and custom groups within those categories. In the custom groups, you can then create shortcuts that point to database objects.

For example, suppose you have many reports in your database, and that you run the reports with varying frequencies, such as daily or quarterly. You might create a Reports category, and then create Daily, Weekly, Monthly, Quarterly, and Yearly groups. In each group, you could then create shortcuts to the appropriate reports.

You can create multiple shortcuts to a database object, each shortcut in a different custom group.

Showing or hiding categories and groups

You can use the Navigation Options dialog box to show or hide some of the categories and groups in the Navigation Pane.

You can also use macro actions to control the display of Navigation Pane categories as a database opens in Access. These new macro actions are available in Microsoft Office Access 2007:

  • SetDisplayedCategories    Use this action to show or hide a category. You can show or hide only one category each time you use this action. However, you can use this action multiple times in a macro to show or hide individual categories as needed.

  • LockNavigationPane    Use this action to lock the Navigation Pane. Doing this helps prevent users from accidentally adding, moving, or deleting items in the Navigation Pane.

    Locking the Navigation Pane does not prevent users from copying database objects to the clipboard.

Navigating to a category or group automatically when the database opens

You can use the NavigateTo macro action to navigate to a category or group. If you use this macro action in the autoexec macro, you can automatically navigate to a category or group when the database opens.

Disabling Design view

The items that are displayed in your custom categories and groups are actually shortcuts that point to database objects.

Shortcuts in the Navigation Pane have a Disable Design View shortcuts property that you can set. Right-click the shortcut, click either Object Properties or (for a table) Table Properties on the shortcut menu, and then select the Disable Design View shortcuts check box. If this property is enabled, the shortcut cannot be used to open its target object in Design view or Layout view. For example, if you enable this property for a shortcut to a form, users cannot change the design or layout of the form by using the shortcut.

Hiding database objects

The built-in categories and groups in the Navigation Pane do not display shortcuts, and instead display actual database objects. These groups include:

  • All groups in any built-in category.

  • The Unassigned Objects group of any custom category.

Database objects do not have a Disable Design View shortcuts property. You can hide database objects to help prevent design changes, and then provide shortcuts to them in custom categories and groups.

Before you begin

By using a combination of these features, you can effectively control the organization of the Navigation Pane to improve usability. However, these features will not prevent a malicious user from making unwanted design changes to your database. Moreover, these features will not prevent unauthorized access to data. Consider the following:

Usability features can be bypassed.    

  • If you use a macro to control and lock the Navigation Pane, remember that users can disable the macro at startup by pressing and holding the SHIFT key.

  • Although Navigation Pane shortcuts have a Disable Design View shortcuts property, database objects themselves do not. You can hide the categories and groups that contain database objects and you can hide the objects themselves, but it is possible for users to unhide them.

Focus on the user.    

  • When you plan and design the navigation system for a database, work with the people who will use it. If it is not practical to work with the specific people who will use a database, keep their needs central to your design process.

  • Depending on your resources, consider using focus groups for planning, and conducting usability tests during design.

Security is not the goal.    

  • Your goal in implementing these features to control the Navigation Pane should be to improve the usability of a database. These features are not designed to help secure a database.

  • For more information about ways to help secure a database, refer to the See Also section.

Top of Page

Customize the Navigation Pane

You can use the Navigation Options dialog box to customize the Navigation Pane.

Navigation Options dialog box

The process follows these broad steps:

  1. Create a custom category. Access provides one pre-built custom category for you: Custom. You can rename that category and add or remove groups to suit your needs. You can also create new custom categories.

  2. Create a custom group. After you create a category, you create one or more custom groups for the new category.

  3. Assign objects to the custom group by creating shortcuts. In the Navigation Pane, you drag or copy and paste the database objects that you want to assign to your custom group. You drag or copy the objects from a special group in your new category called Unassigned Objects, which Access creates for you whenever you create a custom category.

    • When you add a database object from the Unassigned Objects group to your custom group, Access creates a shortcut to that object — you are not moving or copying the object itself.

    • If you rename or delete a shortcut in a custom group, those changes do not affect the actual object, only the shortcut to it.

    • You can create as many shortcuts to a database object as you want. Each group should have only one shortcut to a given database object.

  4. Show or hide groups or objects in a custom category. After you populate your custom group or groups, you can hide the Unassigned Objects group and any other groups that you don't want to display. You can also hide individual objects.

    You can also use the SetDisplayedCategories macro action to show or hide a category. By using a macro, you can show or hide categories regardless of the settings in the Navigation Options dialog box. For more information, see the section Control the Navigation Pane by using a macro.

Create a custom category

  1. Right-click the menu at the top of the Navigation Pane and then click Navigation Options.

  2. In the Navigation Options dialog box, under the Categories list, click Add Item.

    A new category appears in the list. This figure illustrates a new custom category:

    A new custom category in the Navigation Pane

  3. Type a name for the new category and then press ENTER.

    Tip: Try to create a name that makes sense to the people who use your database. After you create the name, notice that the caption for the list on the right changes to match that name. For example, if you name the new category My Switchboard, the caption in the list on the right reads Groups for "My Switchboard". Also, notice that the list contains a group called Unassigned Objects. Access creates that group by default. This group contains all of the objects in your database, and you use those objects to populate your custom group.

    After you create your custom category, you create one or more groups for that category. You can create as many groups as you need. Keep the Navigation Options dialog box open and follow the next steps.

Create a custom group

  1. Under the Groups for "Group Name" list, click Add Group and then type a name for the group. You can repeat this process as often as you need. For example, My Switchboard might contain three groups — Data Entry Forms, Reports, and Queries. The needs of your users or your own preferences should determine the groups that you add.

  2. Leave the check box next to Unassigned Objects selected, and then click OK.

    Access closes the Navigation Options dialog box and adds your new custom group to the Navigation Pane, but you cannot yet see the new group.

  3. Go to the next set of steps to make the new group visible and to add objects to the group.

If you just want to add an item to a new custom group, right-click the item and then, on the shortcut menu, point to Add to group and then click New Group.

Assign objects to the custom group by creating shortcuts

  1. Click the menu at the top of the Navigation Pane and, in the upper section of the menu, click your new category.

    The group or groups that you created for your category appear in the lower section of the menu, along with the Unassigned Objects group.

  2. Drag items from the Unassigned Objects group to a custom group.

    To move multiple items at once, hold down CTRL while you click the items, and then drag the items to a custom group.

Show or hide groups and objects in a custom category

You can hide some or all of the groups in a custom category and some or all of the objects in a group. Remember these facts as you proceed:

  • Access provides two ways to hide items. You can use commands that are provided by the Navigation Pane to hide a shortcut in a group, or you can set a database object's Hidden property to hide shortcuts to the object in all the groups and categories in the open database, including built-in categories and groups.

  • You can make hidden objects and groups completely invisible, or you can display them in the Navigation Pane as dimmed, unavailable icons. You do this by selecting or clearing the Show Hidden Objects check box in the Navigation Options dialog box. You also use that check box when you need to unhide, or restore, a group or an object.

The steps in the following sections explain how to perform each task.

Hide a group in a category

  • In the Navigation Pane, right-click the title bar of the group that you want to hide, and then click Hide.

    You can also hide a group by using the Navigation Options dialog box. Open the dialog box (see the steps in the next section if you don't know how) and, in the Groups for "category" list, clear the check box next to the group that you want to hide.

Restore a hidden group to a category

  1. Right-click the menu bar at the top of the Navigation Pane and then click Navigation Options on the shortcut menu.

  2. In the Categories list, select the category that contains the hidden group.

  3. In the Groups for "category" list, select the check box next to the hidden group.

  4. Click OK.

Hide a shortcut or object only in its group

  • In the Navigation Pane, right-click the shortcut or object, and then click Hide in this Group.

    Note: This command is not available for objects in the Unassigned Objects group of a custom category.

Hide an object from all categories and groups

  1. Right-click the object that you want to hide, and then click Object Properties or (for a table) Table Properties on the shortcut menu.

    The Object_name Properties dialog box appears, and Access appends the name of the object to the dialog box title. For example, if you open a form called Orders, the dialog box title displays Orders Properties. The following figure shows the dialog box.

    The Properties dialog box for a database object in Access

  2. Select the Hidden check box.

  3. Click OK.

Restore (unhide) a hidden object

  1. Right-click the menu at the top of the Navigation Pane and click Navigation Options on the shortcut menu.

  2. Under Display Options, select the Show Hidden Objects check box.

  3. Click OK and return to the Navigation Pane.

    The pane shows a dimmed icon for all hidden objects.

  4. Do one of the following:

    • If you hid a shortcut in a group, right-click the shortcut and then click Unhide in this Group.

    • If you hid an object from all categories and groups by setting the Hidden property, right-click the object, click Object Properties or (for a table) Table Properties, and then clear the Hidden check box.

Remove and restore shortcuts in custom groups

Your custom groups may change over time, as user and business demands change. You can add or remove the shortcuts in a group at any time.

Remove a shortcut from a custom group

  • In the Navigation Pane, right-click the shortcut that you want to remove, and then click Remove.

Restore a shortcut to a custom group

  1. If the Unassigned Objects group is hidden, display it.

    How do I display the Unassigned Objects group?

    1. Right-click the menu at the top of the Navigation Pane and click Navigation Options on the shortcut menu.

    2. In the Groups for "category" pane, select the check box next to Unassigned Objects.

  2. As needed, drag or copy and paste the object that you want from the Unassigned Objects group to your custom group.

Rename a shortcut in a custom group

  1. In the Navigation Pane, right-click the shortcut that you want to rename, and then click Rename Shortcut.

  2. Type the new name for the shortcut and then press ENTER.

Top of Page

Control the Navigation Pane by using a macro

To control the Navigation Pane by using a macro, you can create a macro that runs when the database opens, and then add actions to the macro.

You can selectively show or hide categories, and you can lock the Navigation Pane to prevent other users from accidentally moving or deleting shortcuts, objects, groups, or categories. You can also navigate to a category or group so that the category or group is displayed when the database opens.

Alternatively, you can hide the Navigation Pane for the duration of a database session.

Use macro actions to control what the Navigation Pane displays

  1. On the Create tab, in the Other group, click Macro. If this command is unavailable, click the arrow beneath either the Module or the Class Module button, and then click Macro.

    Note: If your database already has a macro named autoexec, you do not need to create a new macro. Add the macro actions described in this procedure to the existing autoexec macro.

  2. On the Design tab, in the Show/Hide group, click Show All Actions.

  3. In the macro design grid, under Action, click the arrow in the first empty cell.

  4. In the list, select SetDisplayedCategories.

  5. Below the design grid, in the Action Arguments pane, click the arrow in the Category box, and then click the name of the category that you want to show or hide.

  6. Just above the Category argument, click the arrow in the Show box, and choose a setting. Choose Yes if you want the category to display in the Navigation Pane. Choose No if you do not want the category to display in the Navigation Pane.

  7. Repeat steps 3 through 6 for each category that you want to control by using the macro.

  8. In the macro design grid, under Action, click the arrow in the first empty cell.

  9. In the list, select LockNavigationPane.

  10. Below the design grid, in the Action Arguments pane, choose a value for the Lock argument. Choose Yes to lock the Navigation Pane.

  11. Press CTRL+S to save the macro. Name the macro autoexec to indicate to Access that the macro should be run when the database opens.

Use a macro action to navigate to a category or group

You can use this macro action at any time, not just when the database opens.

  1. On the Create tab, in the Other group, click Macro. If this command is unavailable, click the arrow beneath either the Module or the Class Module button, and then click Macro.

    Note: If your database already has a macro named autoexec, you do not need to create a new macro. Add the macro actions described in this procedure to the existing autoexec macro.

  2. On the Design tab, in the Show/Hide group, click Show All Actions.

  3. In the macro design grid, under Action, click the arrow in the first empty cell.

  4. In the list, select NavigateTo.

  5. Below the design grid, in the Action Arguments pane, click the arrow in the Category box, and then click the name of the category that you want to navigate to.

  6. If you want to navigate to a specific group in the category, click the arrow in the Group box, and then click the name of the group that you want to navigate to.

  7. Press CTRL+S to save the macro. Name the macro autoexec to indicate to Access that the macro should be run when the database opens.

Use a macro action to hide the Navigation Pane

If you prefer to create your own navigation system, you can hide the Navigation Pane by using the RunCommand macro action and the WindowHide argument. Running this macro action with this argument hides the Navigation Pane for the duration of the current database session.

  1. On the Create tab, in the Other group, click Macro. If this command is unavailable, click the arrow beneath either the Module or the Class Module button, and then click Macro.

    Note: If your database already has a macro named autoexec, you do not need to create a new macro. Add the macro actions described in this procedure to the existing autoexec macro.

  2. On the Design tab, in the Show/Hide group, click Show All Actions.

  3. In the macro design grid, under Action, click the arrow in the first empty cell.

  4. In the list, select RunCommand.

  5. Below the design grid, in the Action Arguments pane, click the arrow in the Command box, and then click WindowHide.

  6. Press CTRL+S to save the macro. Name the macro autoexec to indicate to Access that the macro should be run when the database opens.

You can also turn the display of the Navigation Pane on or off by using the Display Navigation Pane check box in the Access Options dialog box. If you use the RunCommand macro action with the WindowHide argument, it will hide the Navigation Pane whether the Display Navigation Pane check box is selected or cleared.

Top of Page

Disable Design view for an item

In the Navigation Pane, you can set a shortcut's Disable Design View shortcuts property to control whether users can use the shortcut to open the target object in Design view or Layout view.

  1. In the Navigation Pane, right-click the shortcut for which you want to disable Design view, and then click Object Properties or (for a table) Table Properties.

  2. In the Object_name Properties dialog box, select the Disable Design View shortcuts check box.

Top of Page

Hide a database object

  1. Right-click the object that you want to hide, and then click Object Properties or (for a table) Table Properties.

    The Object_name Properties dialog box appears, and Access appends the name of the object to the dialog box title. For example, if you open a form called Orders, the dialog box title displays Orders Properties. The following figure shows the dialog box.

    The Properties dialog box for a database object in Access

  2. Select the Hidden check box.

  3. Click OK.

Restore (unhide) a hidden object

  1. Right-click the menu at the top of the Navigation Pane and click Navigation Options on the shortcut menu.

  2. Under Display Options, select the Show Hidden Objects check box.

  3. Click OK and return to the Navigation Pane. The pane shows a dimmed icon for all hidden objects.

  4. Do one of the following:

    • If you hid a shortcut or object only from a group, right-click the object and then click Unhide in the Group.

    • If you hid an object from all categories and groups by setting the Hidden property, right-click the object, click View Properties, and then clear the Hidden check box.

Top of Page

No comments:

Post a Comment