[AccessD] Report Group Page Breaks with no break fortheReportFooter

A.D.TEJPAL adtp at hotmail.com
Tue Sep 19 07:14:28 CDT 2006


    You are most welcome John!  I am glad your problem stands resolved. You have done a nice job of adapting the suggested solution in an optimum manner. Using a report level global variable for storing the total count is an excellent step.

A.D.Tejpal
---------------

  ----- Original Message ----- 
  From: John Skolits 
  To: 'Access Developers discussion and problem solving' 
  Sent: Tuesday, September 19, 2006 16:24
  Subject: Re: [AccessD] Report Group Page Breaks with no break fortheReportFooter


  That seemed to work. Thanks!

  The only change was that I created a local variable for the report module called lng_rsCount  and loaded the Dcount Value into it, during the "OnOpen" event of the report.

  In that way the Dcount didn't run multiple times as it does in the format
  event. It was making the report open up too slowly.

  Thanks again.

  John

  -----Original Message-----
  From: accessd-bounces at databaseadvisors.com
  [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of A.D.TEJPAL
  Sent: Monday, September 18, 2006 1:48 PM
  To: Access Developers discussion and problem solving
  Cc: ADT
  Subject: Re: [AccessD] Report Group Page Breaks with no break for
  theReportFooter

  John,

      Apparently you wish to force page break after the group footer in such a manner that normally, such break gets forced compulsorily, while at the end of report, there should be no forced page break if adequate space is available to accommodate the report footer as well.

      It is suggested that you should avoid setting any page break in report
  design via properties dialog box of group footer. Instead, insert the sample code given below, in format event of appropriate group footer. TxtCount is the name of calculated text box in Detail section (with the expression =1). Its running sum property should be set to Overall.

  Best wishes,
  A.D.Tejpal
  ---------------

  ================================
  Private Sub GroupFooter1_Format(Cancel As Integer, _
                                              FormatCount As Integer)    
      If TxtCount < DCount("*", Me.RecordSource) Then
          ' Not yet yet reached the end of report. Force
          ' new page after group footer.
          Me.GroupFooter1.ForceNewPage = 2
      Else
          ' End of report has been reached. No need to
          ' force new page. Access will take care of
          ' placing the report footer either on current page
          ' or the next one, depending upon room available.
          Me.GroupFooter1.ForceNewPage = 0
      End If
  End Sub
  ================================


More information about the AccessD mailing list