ACC: How to Print Group Footer at Specific Location This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.
This article was previously published under Q119655 On This PageSUMMARY
Moderate: Requires basic macro, coding, and interoperability skills.
This article describes how to print a report's group footer information at a specific place on the page. This can be useful when you are printing reports to preprinted forms. Although you cannot do this using the group footer's property settings, you can use any of the following three methods:
NOTE: Visual Basic for Applications is called Access Basic in Microsoft Access versions 1.0 and 2.0. For more information about Access Basic, please refer to the "Building Applications" manual. MORE INFORMATIONMethod 1: Using the Page FooterThe page footer is always printed at a fixed location on the report's page, just above the bottom margin. For example, if your report has a bottom margin of 1 inch and the height of the page footer is 1 inch, the page footer begins 2 inches from the bottom of the page, or 9 inches from the top of the page (for an 11 inch long page). Placing the group footer controls in the page footer causes them to be printed at the page footer's fixed location on the page.NOTE: You cannot use aggregate functions in a control in a page footer. If you need to use aggregate controls in your footer, please see the following Microsoft Knowledge Base article: 129096 (http://support.microsoft.com/kb/129096/EN-US/) ACC: How to Sum a Calculation in a Report Method 2: Setting Report Properties for the Footer SectionThis method involves using the MoveLayout, PrintSection, and NextRecord report properties to move the group footer to a specific printing location on the page. With this method, you are not actually specifying the group footer's coordinates on the page, but moving the group footer to various existing printing locations on the report page.To ensure that the group footer is printed where you want it to be, you must consider the height of each section of the report. Since you cannot specify the location of the group footer section (or any other section) with a property setting, you must use the MoveLayout property to move the section to the next available printing location. For example, if the group footer section's height is 0.5 inches and the Top property (which specifies how far from the top of the report the section is printed) is set to 3.75 inches, then the MoveLayout property moves the group footer section to be printed in the area from 3.75 inches to 4.25 inches from the top of the report (a total of 0.5 inches). The following example demonstrates how to print the group footer at a specific place on the page by adjusting the section heights, and by using a sample user-defined function called SetGrpFtrLoc() that tests to see if the Top property is set to less than the GrpFtrLoc setting (the location where the group footer will be printed). If it is, the function moves the group footer section to the next printing location. If not, it does not move the group footer. CAUTION: Following the steps in this example will modify the sample database Northwind.mdb (or NWIND.MDB in versions 2.0 or earlier). You may want to back up the Northwind.MDB file, or perform these steps on a copy of the Northwind database.
Method 3: Setting Report Properties for the Detail SectionA similar approach is to use the MoveLayout, PrintSection, and NextRecord properties to print a blank detail section until the location for printing the group footer section is reached. This method is preferable to moving the group footer section if the detail section is smaller than the group footer section.The following example demonstrates how to print the group footer at a specific place on the page by using a sample, user-defined function called SetDetailLoc() that tests to see if this is the last detail section. For the last detail section, it then tests to see if the Top property is set to less than the GrpFtrLoc setting (the location where the group footer will be printed). If it is, the function moves the detail section to the next print location. If not, it does not move the detail section.
REFERENCES
Microsoft Access "User's Guide," version 2.0, Chapter 26, "Using Macros to
Print Reports or Transfer Data," pages 693-696
In Microsoft Access versions 2.0 and 7.0, for more information about the MoveLayout, NextRecord, and PrintSection report properties, press F1 and in Help search for "MoveLayout" then "MoveLayout, NextRecord, and PrintSection Properties." In Microsoft Access 97, for more information about the MoveLayout, NextRecord, and PrintSection report properties, press F1 and ask the Microsoft Office Assistant. APPLIES TO
| Article Translations
|


Back to the top
