Access provides several methods of producing output for your data. After you preview your data and adjust the page setup options as necessary, you can send the data directly to a printer. You can print a table, query, form, or report, or portions thereof. You can create a special type of report, mailing labels, and you can merge your data to Microsoft Word.
In addition, you can fax or e-mail your data from Access, or publish your Access forms or reports on the Web.
A mailing label is a special type of report formatted to repeat across or down a page. You have control over the contents of your mailing label through the placement of bound controls displaying your field data, text labels, graphics, and so on. You can also control the size of the labels and their repetition pattern.
Through the use of queries, you can specify which records will have labels printed for them. The Label Wizard makes it particularly easy to create mailing labels.
TIP: You can sort by any field in your underlying table or query, even those that do not appear on your prototype label.
If one of your tables or queries contains client data, you might want to send a letter to everyone in the list. If you have Microsoft Word installed, you can personalize each letter.
TIP: Create a query to be the source of your mail merges. You can then modify the criteria every time you send a letter (when an address changes, you have a new client, or your printer mangled the first copy). See "Query: Create with Design View" in the Queries and Filters part of the book.
NOTE: If you Merge to New Document, Word creates a temporary document titled FormLetters1 with the results of the merge. You do not need to save this document when you exit Word. You should, however, save your document with the merge field codes.
You can send Access tables, queries, or reports through electronic mail instead of printing and mailing through the post office. To send Access data through electronic mail, you need to use either Microsoft Exchange (or another mail system compatible with MAPI--Messaging Application Program Interface) or Lotus cc:Mail (or another mail system compatible with VIM--Vendor Independent Messaging). For additional information, search on "electronic mail" in Microsoft Access Help.
NOTE: To perform this procedure, you must have already installed electronic mail software.
2. Choose File, Send.
3. In the Send dialog box, select the format of the data that will
be attached to your message; then choose OK. Access opens a mail form with your data
attached.
4. Fill in your message form, and send your message.
NOTE: Depending on your Access object (table, query, form, or report), Access allows data to be sent as HTML, ActiveX (.ASP), Excel (.XLS), IIS (.HTX or .IDC), MS-DOS text (.TXT), or Rich Text Format (.RTF) files.
If you want your page to break in the middle of a section, you can insert a page break control on the report. For example, if you have two subreports, you might want to insert a page break between them.
NOTE: You can also use this same procedure to insert a page break in Form Design View if you print your forms.
To remove the page break, select the page break control and press Delete.
NOTE: You can also set page breaks with the properties of the sections on your report. Open the report in Design View and double-click the gray bars indicating the detail section or a group header or footer. In the Property sheet, move to the Force New Page property (on the Format tab) and choose to create a page break Before Section, After Section, Before & After, or None to let pages break at the end of a full page.
To try to avoid a page break within sections, change the Keep Together property to Yes. To try to keep all sections (header, footer, and detail) relating to one group together on a page, click the Sorting and Grouping button and change the Keep Together Grouping property to Yes. Access will try to place page breaks to keep a group together. However, if the group is larger than one page, it won't be able to. In this case, choose With First Detail to at least keep the group header with the first record.
For long reports, you will want Access to place page numbers on your report. This is especially true if you are handing out the report to various people and everyone needs to refer to specific pages.
Access places a text box with the appropriate expression on your report. The [Page] code indicates the page number. [Pages] indicates total number of pages. Additional text is enclosed in quotes such as "Page". The Control Source property of the text box shows this expression (and you can press Shift+F2 to see a long expression). To remove the page numbers, click the text box and press Delete.
If you have a pre-printed form, you can design an Access form to print in the fill-in areas. When you print, you can choose to have Access print only the data.
Now when you print all the records or one record (see "Print Forms" and "Print One Record from Form"), Access will only print the data and not the labels for the fields.
By default, Access prints with one-inch margins at the top and bottom, and left and right sides of the document. You can use the Page Setup dialog box to change these margins, if necessary. If your document is small, for example, you can increase the margins. If the document is slightly bigger than the page, you might want to decrease the margins.
Access saves the page setup information with the design of the object. You might also need to change the size of columns in a table or query to fit everything on a page. (See also "Width of Column" in the Database Essentials part of this book.) In a form or report, you might need to drag the right edge of the work area in Design View to change the printed width area.
If the document you want to print is wider than it is tall, you can switch to a landscape orientation when you print. Choose Landscape orientation to print the document across the long edge of the page. Use Portrait orientation (the default) to print across the short edge of the page.
Although reports are the primary object for printing, you can also print information on forms. You can print one record (see "Print One Record From Form") or the entire data source. Depending on your starting location, you can print the Form or Datasheet View.
Some people print labels to dot matrix printers using tractor-feed stock. The best way to do this is to create a printer file that contains the page setup appropriate for this task. If the paper is a predefined label stock, an easier alternative is to use the mailing labels feature. (See "Mail Labels: Create in Report.")
A label layout is a report layout that has no header or footer, only a detail part. If you are creating a label from scratch, then choose File, Page Setup to open the Page Setup dialog box to set the following:
Sometimes you only want to get the details from one form's record. Perhaps you want to find missing information on a client or use the form for directions to a meeting. If you want to print only one record, use the record selector at the left edge of the form.
NOTE: If the record selector is not available, you need to set the Form's Record Selectors property to Yes. To set this property, double click the Form/Report Selector in the upper-left corner of the form to open the Form property sheet, go to Record Selectors (on the Format tab) and choose Yes.
If you often print one record, consider adding a button on the form intead of using the procedure mentioned in "Print one Record from Form."
Now when you are in Form View, you can click the command button you added to print just the current record.
The Print Preview mode provides a view of your datasheet, form, query, or report as it would print to your current printer. It is always a good idea to preview your printed output before printing to find if the report contains the wrong information or is not the desired format. Especially for large reports, you'll want to use Print Preview first to avoid killing a tree.
If you preview a form from Design or Form View, your preview is in Form View. If you preview a form from the Datasheet View, then your preview is in Datasheet View. If you preview a form selected in the Database window, then the Default View property controls the view you see in Preview mode. To change the default view of the form, double-click the Form/Report Selector in Design View and choose an option in the Default View property.
The following table shows you how to perform various tasks in the Print Preview view.
Print Preview Tasks |
|
To Do This | Press This |
To open the Print dialog box | P or Ctrl+P |
To open the Page Setup dialog box | S |
To zoom in or out on a part of the page | Z |
To cancel Print Preview or Layout Preview | C or Esc |
To move to the page number box; | F5 then type the page number and press Enter |
To view the next page (when Fit To Window is selected) | Page Down or down arrow |
To view the previous page (when Fit To Window is selected) | Page Up or up arrow |
To scroll down in small increments | Down arrow |
To scroll down one full screen | Page Down |
To move to the bottom of the page | Ctrl+down arrow |
To scroll up in small increments | Up arrow |
To scroll up one full screen | Page Up |
To move to the top of the page | Ctrl+up arrow |
To scroll to the right in small | Right arrow |
increments | |
To move to the right edge of the page | End or Ctrl+Right arrow |
To move to the lower-right corner of the page | Ctrl+End |
To scroll to the left in small increments | Left arrow |
To move to the left edge of the page | Home or Ctrl+left arrow |
To move to the upper-left corner of the page | Ctrl+Home |
Access 97 offers you two different types of previews: Print Preview and Layout Preview. In the former instance, you see everything that will print to your printer, each page and all of the data contained therein. For long print jobs, it can take a while for your computer to process this information. If you want to view a small group of your records in preview, you can see an example layout in the Layout Preview mode. In this mode, you see just enough data to get a feeling for all of the sections of a report.
CAUTION: Layout Preview can be misleading because you don't get a view of all of your data. If you are using a query that contains para-meters, for example, Layout Preview will not detect this and show you a truly representative data set. For reports that don't take a long time to process, you are better off using the Print Preview view to see your reports.
Reports are the best way to get data outputted to a printer. Although you can print tables, queries, and forms, none of the other objects offer the formatting and printing options that reports do. For example, only in reports can you get grouped data with subtotals and the detail data as well. (See "Reports: Grouping" in the Forms and Reports part in this book.) You can also print reports from various locations.
NOTE: To print a report without specifying print options, in Report Design View or Print Preview, you can click the Print button on the toolbar.
If you want to interrupt printing and you are fast, click the Cancel button that appears in the Printing dialog box. You also might be able to double-click the Printer icon in the taskbar and cancel the print job by choosing Document, Cancel Printing in the Printer window.
You can print multiple pages of a report or form. On a form or columnar report, if you want to print different records, add a page break at the bottom of Design View. (See "Page Break: Insert on Report.") Then the page numbers correspond to the record numbers. An alternative is to go to each record you want to print in Form View and print that record. (See "Print One Record From Form.")
Instead of printing a report, you can print the Datasheet View of a table or query for quick results. Although you have little control over the formatting (see "Datasheet: Appearance Change" in the Table and Database Design part of this book), all you might need is the grid produced from Datasheet View.
TIP: You can also print from the Database window. Right-click a table or query and choose Print.
NOTE: Access automatically adds a header with the table or query name centered, the date right justified, and the page number centered in a footer. If you don't want to print the header and footer, choose File, Page Setup; click the Margins tab; and uncheck the Print Headings check box. Then follow the steps to print your table or query. You cannot edit the header and footer on a table or query.
Before you begin printing your document, you can specify how many copies you want to print. If you want to print multiple copies of a multi-page document, be sure to preview before you print.
You also can choose whether or not to collate the documents as they are printed. Normally, you will want to choose the Collate option, which prints all pages of a document before it prints the document again.
(See "Print Preview" before you complete this task.)
You can control printing to a fine degree by adding programming to the print events for a report. You add programming to print or not print certain sections or controls on your report, depending on choices you make on dialog boxes or the underlying values of the data.
One of the report print events is On No Data. If the report doesn't have any data to print, there is no sense printing a blank report. The following steps show you how to display a dialog box and cancel the printing (or previewing) of a report.
The other print event associated with the report is On Page which will trigger before the page is printed but after the Format events for report sections. The Report and Group Header and Footer and Detail sections also have print events. To see help on the events, open a Property sheet, click the Events tab, select one of these sections, and move to one of the properties (On Format, On Print, or On Retreat). Then press F1.
NOTE: For an example of the On Format property in the sample Northwind database, open the Sales by Year report and look at the On Format property for the Detail section. The programming includes
If Forms![Sales by Year Dialog]!ShowDetails = False Then Cancel = True
When you open this report in Print Preview or attempt to print it, a form (Sales by Year Dialog) opens with a check box named ShowDetails. If the user unchecks the ShowDetails box, the detail section will not print.
Some people will begin their foray into database publishing to the Web by visiting the new Web Publishing Wizard. This wizard guides you through the process of Web page and site creation. You start the Web Publishing Wizard by selecting the Save As HTML command from the File menu. The Web Publishing Wizard can output datasheets, forms, and reports as static or dynamic Web documents using template files. It can create a home page that has links to your other documents. You can use the Web Publishing Wizard to copy the files and folder created to your Web server.
TIP: Microsoft Office contains a Web Fast Find Search page that you can use to search for files on an intranet. You can locate files by keywords. Consider including this page in any site you create with the Web Publishing Wizard. Consult your administrator to get a copy, or learn about the location of this page on your intranet.
Access creates the pages you specified from each object. It also creates, if specified, the publication profile.
©Copyright, Macmillan Computer Publishing. All rights reserved.