Hack 31. Provide a Direct Link to a Report
What can be easier for a manager or a database-challenged individual than just skipping the process of opening the database? You can easily provide this functionality by including a shortcut directly to the report. The shortcut goes on the user's desktop.
4.5.1. Creating a Shortcut
To create such a shortcut, first open the database, and then right-click the desired report. The context menu includes a Create Shortcut… menu item, as shown in Figure 4-13.
When the user clicks the Create Shortcut… menu item, a dialog box pops up for her to select where to place the shortcut. The user's PC desktop will probably be filled in as the default, as shown in Figure 4-14.
After the user clicks the OK button, the desired shortcut is created. Clicking the shortcut starts up the database and opens the report, but unfortunately, the database stays open.
Figure 4-13. Creating a shortcut to a report
Figure 4-14. Selecting the location for the shortcut
4.5.2. Printing a Report and Closing the Database in One Click
A better approach is to enable the user to click the shortcut, print the report, and close the database afterward, all automatically via a single click. Sounds like a macro to me!
Figure 4-15 shows a simple macro that prints a report and then closes the database.
Figure 4-15. Using a macro to run the report and close the database
All that is necessary is the action to open the report. It's important that View is set to Print, not to Print Preview or Design. This sends the report directly to the printer instead of displaying it. The follow-up Quit action closes the database.
Note that if the report is usually generated with selections made on a form, you should create a shortcut to the form instead. You can create such shortcuts for any database object.