Jan's Illustrated Computer Literacy 101 Logo:Jegsworks Jan's Illustrated Computer Literacy 101


Home > Jan's CompLit 101 > Working with Databases > Basics > Access Objects > Print Form
Icon: Arrow - Previous pagePrevious    NextIcon: Arrow - Next page

Jan's Working with Databases

   Basics: Access Objects: Print Form

Producing a useful, readable print-out of a form or report takes some planning.

The Page Setup dialog, the Property Sheet pane, and the Print dialog are where you can make choices to get your form or report printed just right.


Page Setup Dialog

Dialog: Page Setup - Print Options (Access 2010) Dialog: Page Setup - Page tab (Access 2010)

The Page Setup dialog has so many options for forms and reports that it uses three tabs. You can control the margins, orientation of the paper, the size of the paper, and which printer.

On the Columns tab you can, with care, set your document to print in more than one column on a page, like newspaper columns. But you must get the widths exactly right. We won't do that just yet!


Property Sheet

The whole form or report, each section, and each control has many properties. Only a few properties are about how the object will print.

Property Sheet > Format tab (Access 2013)Properties related to printing:

Width for a form or report is a the width of the content, NOT of the physical page. The width of the physical paper you are going to use must be larger than Width plus the left and right margins. So if you are printing in Portrait orientation and the paper is 8½ by 11 inches and the margins are ½" left and right, then the Width property has to be 8" or less to fit on the paper.

Can Grow and Can Shrink allow a control or section to get taller or shorter depending on whether the amount of text. This makes some records take more space than others. But it keeps you from wasting a lot of space in those records with a small amount of text just because there are a few with a lot more text. Another plus is that you don't have to know ahead of time exactly how much space to provide. This is a VERY helpful property!

Detail Section: Keep Together can be set for the Detail section to keep a record from being split between pages. This can create empty space at the bottom of a page.

Page Header and Page Footer appear on printed pages. For a report, these can be set to show on all of the pages or not on the page with the Report Header or the Report Footer, or both.

Print Dialog

Dialog: Print (Access 2010) The Print dialog lets you choose a printer, what part of the object to print, and the number of copies.

The Properties button at the top right of the Print dialog opens a dialog that comes with the selected printer. Use that dialog to access special features of your printer, especially when using special paper like card stock or photo paper or envelopes.


Icon Step-by-Step 

Step-by-Step: Print Form

 Icon Step-by-Step

What you will learn: to view form's Print Preview
to edit form and properties
to select the whole form
to select multiple controls by dragging
to add a page header and footer
to hide the page header
to add and position a new label
to print a form - all pages

Start with: mytrips-Lastname-Firstname.accdb from a previous lesson

Form: Print Preview

The Property Sheet often has choices that affect the way the form or report behaves. Other properties affect only the appearance.

Can Grow and Can Shrink Properties for text boxes and Detail section: 
By setting these properties to Yes for the controls for Memo/Long text fields and for the Detail section, the controls can expand and contract to fit the amount of text. The Detail section will also expand to hold the controls.

Keep Together Property for Detail section:
By setting this property to Yes, all of a record's controls will print together and will not be split between two pages. However, if the form is too wide for the paper, a second page will print before the next record is printed. Of course if the record will not fit on one page, another page will print.

  1. Icon: Form View Open the form Trips AutoForm.
  2. Icon: Print Preview Switch to Print Preview.
    Icon: Access 2007Access 2007:Button: Office> Print > Print Preview
    Icon: Access 2010 Icon: Access 2013 Icon: Access 2016 Access 2010, 2013, 2016: File > Print > Print Preview
  3. Trips AutoForm in Print Preview - 2 pages (Access 2010)Button: Two Pages (Access 2010)Click the Two Pages button.

    The Navigation buttons are not grayed out, so not all of the pages are showing.

    The first page holds two complete records and the top part of a third.

    The second page is nearly blank! All that is showing is a thin slice of the form that did not fit on the first page.

    What needs fixing?

    • The form width is just a bit too large to fit on the paper with the current margins. That creates pages that are mostly blank, except for the thin slice that would not fit on the page.

      (Your form may have a different width if you accidentally changed it while trying to resize the controls earlier.)

    • The Diary field is cut short in the first record. 

    • The page header and page footer are blank.
    • The background color will print.
    • There is empty space below the TripID and TripName controls.

    Happily, you can make changes that will help.


Form: Edit Properties

  1. Trips AutoForm in Design View (Access 2010)Icon: Design View Switch to Form Design View.
  2. If necessary, open the Property Sheet by clicking Button: Property Sheet (Access 2010) Button: Property Sheet (Access 2013) the Property Sheet button on the ribbon tab Form Design Tools: Design. This should be the current ribbon tab.

    Icon: TroubleProblem: Property Sheet vanished
    You clicked the Property Sheet button when the pane was already open. That action closed it. 
    Solution:
    Click the button again and it will reappear.

  3. Form Design View: Select memo fieldsClick on the control Description, which is a Memo/Long Text field.
    The control shows orange borders as a selected control.
  4. Hold the SHIFT key down and click on the TravelAgent and Diary controls.
    All three controls are selected at the same time.

    Property Sheet: multiple selection (Access 2010)The top of the Property Sheet shows Multiple selection:

  5. Dialog: Properties - multiple slection - Can Grow, Can ShrinkCan Grow/Can Shrink:
    • In the Property Sheet, click on the Format tab
    • Scroll to the bottom of the list,
    • Change the Can Grow and Can Shrink properties to Yes.
       
      (These properties are also found on the All tab, which lists all of the properties on the other tabs.)
       
  6. Dialog: Properties -Detail - Keep togetherTrips AutoForm in Design View - Detail selected (Access 2010)Keep Together:
    • Click on the Detail bar to select the Detail section (the part that has the form's controls in it).
      The Detail bar turns black. The Property Sheet changes to show that Detail is selected. 
    • On the Format tab, change the Keep Together property to Yes.  
  7. Width:
    • Click on the box at the top left corner of the Design View, to the left of the horizontal ruler.
      This selects the whole form.
    • Find the Width property in the Format tab or All tab.
    • Enter the value 8" and press the ENTER key.
      The value resets! Resetting the form's width won't resize or move any controls. The AutoForm process made the controls run a bit past the 8" line. You must revise the form so that all of the controls are to the left of the 8" grid line.
    • Drag across the wide controls to select all that you touch.
      You just have to touch a control with the outline to include the control in your selection.

      Drag to select controls (Access 2010) Controls selected (Access 2010)

    • Dragging controls narrower (Access 2010)If necessary, scroll to show the right edge of the form.
    • Move the mouse pointer to the right edge of a selected control until the pointer changes to the Resize Horizontal shape, Pointer: Resize Horizontal.
    • Drag to the left until the indicator on the ruler is just inside the 8" mark. Drop.
      All selected controls are resized.
    • Controls moved and form width = 8" (Access 2013)While the controls are still selected, drag up next to the TripID and TripName controls and drop. Leave two rows of dots visible below the TripName control.
    • Drag the Form Footer bar up to remove the empty space below the Diary control.
    • Select the whole form again.
    • Change the Width property in the Property Sheet to 8" and press the ENTER key.
      This time the value is accepted!
  8. Switch to Form View and navigate through the records.
    No changes! Why not??
    These particular properties apply to the printed version of the form.
  9. Icon: Class diskSave Object As: with a new name - Trips AutoForm for Print.
  10. Icon: Print Preview Open Print Preview again.
  11. Print Preview: after setting Can Grow and Can Shrink to Yes - page 1 (Access 2013)Navigate through the pages. Do you see changes now??
    • The first page no longer has part of record #3.
    • The Memo/Long Text controls are shrinking and expanding to fit the text.
    • No records are split between pages.
    • It takes 5 pages to print these records.

    Hurrah!

    Notice that there is nothing in the header or footer of the page. The AutoForm wizard does not put anything there, but you can.


Form: Page Header/Footer

The AutoForm wizard did not include a page header or footer for this form. A form can have both form header and footer and page header and footer.

Form header or footer: Shows in the window all the time as you navigate to each record. When printed, the form header and footer appear only once! The form header prints at the top of page 1 and the form footer prints after the last record on the last page.

Page header or footer: Appears on each printed page. The page header appears below the form header. The page footer appears at the bottom of the page. This may not be quite what you expected!

The wizard did not put page numbers in Print Preview for the form. You will create a page footer and add a control to show the page number. Access 2007 has a button on the ribbon to add the page number but Access 2010, 2013, and 2016 do not. You could add that command to the Quick Access Toolbar or to a custom tab group or custom ribbon. This time you will use a Copy-and-Paste work-around to get the control that you need.

  1. Icon: Design View Switch to Form Design View.
  2. Right Click Menu: Form sectionRight click on a section bar or in a blank area of the form and select Page Header/Footer from the context menu.

    Page Header and Page Footer sections appear (Access 2013)Two new sections appear in the Form Design View.

  3. Click on the Page Footer.
    The Page Footer section bar turns to black to show that the section is currently selected.
     
  4. Trips Report Wizard with page control selected (Access 2010)Icon: Design View Open the report named Trips Report Wizard in Design View.
  5. Click on the control in the Page Footer that shows the page number.
    This control shows the expression, ="Page " & [Page] & " of " & [Pages], that produces text like "Page 2 of 12". We will learn more about expressions later.
  6. Use the key combo CTRL + C to copy this control.
  7. Icon: Design View Switch back to the form Trips AutoForm for Print in Design View.
  8. Click in the Page Footer area.
  9. Use the key combo CTRL + V to paste the control.
  10. If necessary, drag the control to position it at the right of the Page Footer, lined up with the right edge of the controls in the Detail section.

    Since we aren't putting anything in the Page Header, that section can be hidden.

  11. Trips AutoForm with new page control (Access 2016)Click on the Page Header bar to select that section.
  12. In the Property Sheet, change the Height value to 0 and press ENTER.

    Alternate Method: Move the mouse pointer over the bottom edge of the Page Header section until the pointer changes to the Resize shape Pointer: Resize Vertical. Drag the bottom edge of the Page Header section up to meet the section bar.

  13. Icon: Class disk Save the form and keep it open.
    [Trips AutoForm for Print]

Form: Add and Position Label

For class you need to have your name on every document you print. You will put your name in a new label in the footer. In the Page Footer there is one control on the right, which creates the page number and aligns its result to the right. That leaves a lot of space in the middle for your name.

  1. Icon: Design View On the Form Design Tools: Design tab in the gallery of controls, click on Label Button: Label (Access 2010) Button: Label (Access 2016).
  2. Move the mouse pointer over the Page Footer to the left of the page number control.
    The shape of the pointer changes shape to the Add Label shape Pointer: Add Label (Access 2010).
  3. Initial blank label (Access 2010)Click.
    A very narrow text box appears.
  4. Type your name.
    The text box expands to hold what you type.
    If your name is long, the text box will overlap the control on the right. That's OK for now.
  5. Label with name entered (Access 2010)Click out in a blank area to deselect your new label.
    A green error triangle appears at the top left of the label.
  6. Click the control to select it and make the Error Options Tag appear.
  7. Hover over the Error Options Tag to make the down arrow appear.
  8. Right Click Menu: Error Smart Tag - Ignore Error (Access 2010)Click on the arrow to make the menu appear.
    Access likes labels to be bound to controls, but some labels just hold words you want to see on the page.
  9. Click on Ignore Error.
    The triangle vanishes.
  10. If necessary, drag the new label to center it in the Page Footer horizontally and to line it up with the other control.
    Remember, the pointer must be in the Move shape Pointer: Move shape (Access 2010) to drag the control.
    (There is no command that will automatically center a control horizontally on the page.)

    If your name is long, the label may need to overlap the control to get it centered on the page. That should be OK. The actual values that show on the page are far to the side. It takes a really, really long name to overlap the text.

    Icon: TipCentering Control: The grid lines are there to help you position objects. The report is 8" wide, so the middle of the width is the grid line at 4". The resizing handle in the middle of the top edge of the label should be lined up with the 4" grid line. That will center the control on the 4" line. You may not be able to get that handle exactly on top of the grid line. Very close works just fine.

    Button: Align - Top (Access 2010)Icon: TipAligning with other controls: To get several controls lined up with each other, you must first select them all. (Click on one, hold SHIFT down, click on each of the others. Or drag across all of them.) Then you can use choices on the Align button on the Form Design Tools: Arrange tab or on the right click menu.


Form: Print

Forms are normally designed for use on screen instead of in print. But you may run into situations where it is convenient to print a form instead of creating a report for that same information.

  1. Print Preview shows the new page numbers (Access 2010)Icon: Print Preview Open the form in Print Preview. Page numbers are showing at the bottom right of each page and your name is in the middle.

    The illustration shows Print Preview after choosing to show 8 pages. Only 5 sheets of paper are needed.

    If you don't hide the Page Header section, the print-out has 6 pages. A small change makes a big difference!

    There are more changes you could make, like removing the alternating background color or rearranging the controls. In Project 3: Forms and Reports you will dig deeper into creating and editing. For now, it's time to print.

  2. Icon: Print In Print Preview, click the Print button Button: Print (2010) Button: Print (Access 2013) to open the Print dialog.
    Select the printer you want to use. Select to print All pages. Click on OK to print.
  3. Icon: Form View Switch to Form View.
  4. Select record #3 by clicking its record selector bar on the left.
  5. Icon: Print Preview Switch to Print Preview again.
    All records are showing.
  6. Dialog: Print - Selected record(s) is grayed out (Access 2013)Click on the Print button.
    The options to print Selected records(s) is grayed out!

    Icon: Tip Printing selected record(s): To print only a selected record, you must select it and then go directly to the Print dialog. CTRL + P
    That way the option to print Selected Record(s) is available. Not an obvious method!

  7. Icon: Form View Return to Form View.
  8. Use the key combo CTRL + P to open the Print dialog.
  9. Icon: Print Click on the options Selected Record(s) and then click on OK.
    Only record 3 prints.
  10. Evaluate: Did the alternating background color create problems with the print-out with your particular printer? Did it take longer to print each page?