ۥ-!@ -'I1U&0$0$$0$0$0$0$020J|0|0|0|0|0 0|00(00000000000000004110$000Rough Draft of Article #1 Summary: This article describes how to create a label that will print at the top of each report page when a group of data spans more than one page. The events used capture the value of the group in the page footer, and if this value is the same as the page header value on the next page, the label containing "Continued from previous page..." is displayed. More Information: Below is a step-by-step example of how to create this report by modifying the sample database NWIND report "List of Products by Category." Open NWIND, the sample database that is included with Microsoft Access. 1. From the File menu, choose Module to create a new module. 2. Enter the following global declaration and functions into the module: '----------------------------------------------- 'Global Declarations '----------------------------------------------- Global CurrentGroupVal as String '----------------------------------------------- 'Code Section '----------------------------------------------- Function SetGlobalVar (InReport as Report) CurrentGroupVal = InReport!SetGroupVal End Function Function SetContinuedLabel (InReport as Report) 'Note: The following three lines are placed on one line: InReport!ContinuedLabel.Visible = IIf(Trim(InReport!CheckGroupVal = Trim(CurrentGroupVal)), True, False) End Function 3. In the Database window, choose the Report button to open the "List of Products by Category" report. Select "List of Products by Category," then choose the Design button. 4. Increase the height of the Details sections to approximately 1 inch. This will make more than one category split between two pages so that "Continued from previous page..." will be displayed. 5. From the View menu, choose Toolbox so that the toolbox is displayed. 6. Using the toolbox, create a label in the page header section, below the existing field, with a caption that reads "Continued from previous page...". Change the Control Name property to "ContinuedLabel". Set the Visible property to "No". You will have to increase the height of the page header to accommodate the label. For additional help on the toolbox and labels, search the online Help file for "toolbox" and "label." 7. From the View menu, choose Field List to display the field list. 8. Create a hidden text box bound to the group field [Category Name]. Place this text box in the page header section, and change the Control Name property to "CheckGroupVal." For additional help binding controls on a form, search the online Help for "Controls: Adding" and select "Binding a control to a field." 9. From the View menu, choose Properties to display the property sheet. 10. Click on any portion of the page header not covered by a control to display the page header properties in the property sheet. 11. Set one of the following properties of the page header: OnFormat: =SetContinuedLabel(Report) -or- OnPrint: =SetContinuedLabel(Report) 12. Create a hidden text box bound to the group field [Category Name] in the page footer section, and change the control name property to SetGroupVal. 13. Click on any portion of the page footer not covered by a control to display the page footer properties in the property sheet. 14. Set one of the following properties of the page footer: OnFormat: =SetGlobalVar(Report) -or- OnPrint: =SetGlobalVar(Report) 15. From the File menu, choose Print Preview. The report "List of Products by Category" will have a "Continued from previous page..." message at the top of the pages where the category details span more than one page. Rough Draft of Article #2 Summary: Group headers are used to identify the beginning of a new group of data. A group header prints once for the detail records in its group. However, the detail records in a group may span several pages or columns (in a vertical multi-column report). ACCESS does not insert the group name if the group flows over to another column or page. Although through Macro's, it is possible to identify the group that the records belong to and print the group name along with the word "continued" at the top of a new page or column. For example, if the detail records for the group "Product Names" starts at the bottom of one page or column and continues at the top of the next, it is possible to print "Product Names continued" on the new page or column. This article will explain in detail how to accomplish this. Listed at the end of this article are other related articles that may aid in Multi-Column report processing. More Information: To create a report that prints "continued", at the top of a page or column, when necessary do the following steps. 1. Create a new Macro Group. 2. Put the following macros in the group. Macro Name Condition Action ================================================================= Page Reset SetValue Set Top1 [Top1]=0 SetValue Print [Top1]=0 SetValue Top=[Top1] SetValue ... *SetValue ... SetValue ... StopMacro SetValue *SetValue Page Reset Actions - (called from Page Header Section) ----------------------------------------------------------------- SetValue: Set the unbound control Top1 to zero. This control is located in the Page Header and tracks where the top of the columns or pages are located. The measurement is in Twips. Item: [Top1] Expression: 0 Set Top1 Actions - (called from all Group Header/Footer Sections) ----------------------------------------------------------------- SetValue: Set the value of the Top1 control to the value of the Top property. Top is a property of reports which gives the number of Twips down from the top of the page. Item: [Top1] Expression: Top Print Actions - (called from Detail Section) ----------------------------------------------------------------- SetValue: This will store the Twip value for the top of the column into the Top1 control. This action will execute for the first detail record on every new page. Item: [Top1] Expression: Top SetValue: This will show the Continued control printing the " continued" message. This will execute if the property Top has the same value as the Top1 control. Item: [Continued].Visible Expression: Yes * SetValue: This will hide a field that is in the detail section. This will execute if the property Top has the same value as the Top1 control. Item: [Fieldx].Visible Expression: No SetValue: This will tell Access not to advance to the next record. This will execute if the property Top has the same value as the Top1 control. Item: NextRecord Expression: False StopMacro: This will terminate execution of the Macro. SetValue: This will hide the Continued control deleting the " continued" message. This will always execute if the property Top does not equal the control Top1. Item: [Continued].Visible Expression: No * SetValue: This will show a field that is in the detail section. This will always execute if the property Top does not equal the control Top1. Item: [Fieldx].Visible Expression: Yes * Note: - Repeat these SetValue actions for each control that is being viewed in the detail of the report. Replace [Fieldx] with each control that is being viewed on the report. 3. Save the macro as 'Continued'. 4. Open the desired report in Design Mode. 5. Set the following properties for the specified sections by selecting each section with the mouse and viewing its properties: Section Name Property Expression ----------------------------------------------------------- Page Header On Format Continued.Page Reset * Group Header On Format Continued.Set Top1 Detail On Format Continued.Print Can Shrink Yes * Group Footer On Format Continued.Set Top1 * Note: - Set the On Format property of all Group Header and Group Footer sections to the expression 'Continued.Set Top1'. This will set the Top1 control, which tracks the Twip value of the top of columns, to the current value of the property Top. 6. Using the Toolbox, create an unbound Text Box and place it in the Detail section. Locate the Text Box at the top, in the same location vertically to the label of the Group Header. Set the following properties of the unbound Text Box: Property Expression ------------------------------------------------------------ Control Name Continued Control Source =[Control Name being grouped on] & " continued" Visible No Can Shrink Yes 7. Using the Toolbox, create another unbound Text Box and place it in the first Group Header section. Set the following properties of the unbound Text Box. Property Expression --------------------------------------- Control Name Top1 Visible No 8. Save and Run the report. As explained, this article shows how to identify the group that records belong to and print the group name along with the word continued at the top of a new page or column. Although, this approach will work with a normal single column report, there is another article written to accomplish this with a single column that is more simplified. The article ID is Q88156, but search on: END bel that will print at the top of each repo'8; #&@BDGJ5ILO0j~02E G < ? y | M P  ),ilFwy!!!!!!Yy"$OQz=^  ECTfh5y7u9NdfJh{}*>@  G I 8!n!p!!!!!!,"."'#)#$$9$z$$$$$$$!!!_$%%%%%%&&)&+&H&J&L&''''!!!F  U& (L"U&@A 'y$'(Times New Roman Symbol&ArialS&S& S&U&"hw%w%1Kim AbercrombieKim Abercrombie