[AccessD] Force a new page in code

Jim Lawrence accessd at shaw.ca
Mon Sep 3 06:45:34 CDT 2007


Hi A.D.Tejal:

Thanks for that information...

Jim

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of A.D.TEJPAL
Sent: Friday, August 31, 2007 7:53 AM
To: Access Developers discussion and problem solving
Cc: adtejpal at gmail.com
Subject: Re: [AccessD] Force a new page in code

Jim,

    For conditional page break, ForceNewPage property can be manipulated in
format event of the section concerned. Sample code in detail section's
format event, as given below, will force a page break after every two
records in the group. TxtCountGrp is a count tracking text box for the
group.

    Note:
    (a) Use of Else clause is always necessary, otherwise after the
condition is once met, the break will keep get applied for each record.
    (b) Different values that can be assigned to ForceNewPage property, and
implications thereof, are explained in HELP.

    If no conditions are involved, ForceNewPage property can be set
permanently in design view (Format tab of properties dialog box for the
pertinent section).

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

================================
Private Sub Detail_Format(Cancel As Integer,  _
                                    FormatCount As Integer)
    If Me.TxtCountGrp Mod 2 = 0 Then
        Me.Detail.ForceNewPage = 2    ' Pg break after section
    Else
        Me.Detail.ForceNewPage = 0    ' No pg break
    End If
End Sub
================================

  ----- Original Message ----- 
  From: Jim Lawrence 
  To: 'Access Developers discussion and problem solving' 
  Sent: Tuesday, August 28, 2007 11:49
  Subject: [AccessD] Force a new page in code


  Hi all:

  Is there a way to force a new page in Access reports under program
control? 

  TIA
  Jim 
-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list