If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Not print group header when group footer prints
Hi, I have a report that contains the column headings for the detail
data in the group header, repeating at the top of each page. This is because I have a subreport printing in the group footer, which has its own different headings. I have a page break occurring before the group footer, but can't figure out how to make the group header not print on pages where the group footer prints. Thanks in advance, Kate |
#2
|
|||
|
|||
Kate wrote:
Hi, I have a report that contains the column headings for the detail data in the group header, repeating at the top of each page. This is because I have a subreport printing in the group footer, which has its own different headings. I have a page break occurring before the group footer, but can't figure out how to make the group header not print on pages where the group footer prints. I have always thought that there is no way to do that. Ever since the RepeatSection property was intorduced, it has not been able to deal with being displayed conditionally. In A97, making the header invisible in its format event or cancelling the format event sent the report into an infinite loop. In AXP, it seems as if MS added some code to prevent the loop, but they did it with the simple expedient of turning the RepeatSection property off (even though we can't change it while the report is running) when the header section tries to make itself invisible or cancel is set to true IN THE FORMAT EVENT. However, while playing around, I found that if you use the print event to Cancel the event it seems(?) to work. Here's the code logic I used in case you want to try it (NO GUARANTEE): Add an invisible text box named txtRecCnt to the group header section and set its control source expression to =Count(*) Add an invisible text box named txtLineNum to the detail section. Set its control source expression to =1 and it RunningSum property to Over Group **** Code in the report's module**** Dim bolLastDetail As Boolean Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer) bolLastDetail = (Me.txtLineNum = Me.txtRecCnt) End Sub Private Sub GroupFooter1_Print(Cancel As Integer, PrintCount As Integer) bolLastDetail = False End Sub Private Sub GroupHeader0_Print(Cancel As Integer, PrintCount As Integer) Cancel = bolLastDetail End Sub I do not have A2K and have not tried this in A2003 so I can not state how those versions deal with this situation. -- Marsh MVP [MS Access] |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Conditional Group Footer | landeye | Setting Up & Running Reports | 2 | March 2nd, 2005 06:09 PM |
Group header doesn't print with the data when the data spans more than one page. | Steve Haught via AccessMonster.com | Setting Up & Running Reports | 0 | February 11th, 2005 02:38 PM |
How do I suppress the page header when the report footer prints? | Kathie Thayer | Setting Up & Running Reports | 2 | January 27th, 2005 05:26 PM |
Same header but even/odd footer (sorry for the new thread) | B?atrice Karjalainen | Page Layout | 1 | December 16th, 2004 12:40 AM |
Help Needed for Groups Please | Paul Black | General Discussion | 15 | June 21st, 2004 02:54 AM |