[AccessD] Blank Lines in report

Kaup, Chester Chester_Kaup at kindermorgan.com
Wed Oct 29 14:07:36 CDT 2008


Thanks for the idea but turns out I need to do something a little different. The first If cLines statement in the sub detail section works as intended inserting a blank line every third row. The second If cLines statement inserts no blank lines. I have run each separately and have walked through the code. What am I missing?

Option Compare Database
Option Explicit
' This code declares the cLines variable as an integer, and the
' cMaxLine constant as five. You can set the cMaxLine constant
' to insert a blank line after as many lines as you want. For
' example, to add a blank line after every eight lines in the
' report, set cMaxLine=8.
Dim cLines As Integer
Const cMaxLine = 3

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
   ' This code adds a blank line by setting the NextRecord and
   ' PrintSection properties.
   If cLines Mod (cMaxLine + 1) = 0 Then
   If cLines = 3 Or cLines = 6 Or cLines = 9 Or cLines = 12 Or cLines = 15 Or cLines = 16 Then
      Me.NextRecord = False
      Me.PrintSection = False
   End If
   cLines = cLines + 1
End Sub

Private Sub Report_Open(Cancel As Integer)
   'This code initializes the cLines variable to zero.
   cLines = 0
End Sub

-----Original Message-----
From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock
Sent: Wednesday, October 29, 2008 11:15 AM
To: accessd at databaseadvisors.com
Subject: Re: [AccessD] Blank Lines in report

Hi Chester

Couldn't you introduce a second constant:

  Const cMaxLine16 = 16

and adjust the code like this:

   If (cLines Mod (cMaxLine + 1) = 0) Or (cLines Mod (cMaxLine16 + 1) = 0) Then
      Me.NextRecord = False
      Me.PrintSection = False
   End If

/gustav

>>> Chester_Kaup at kindermorgan.com 29-10-2008 17:02:07 >>>
I have some data in a table I need to display in a report. The problem is I need a blank line in the report after the 3rd, 6th, 9th, 12th, 15th and 16th record. I found some code in MS article 208696 but that is only for every nth record. The stumbling block is the last interval. Maybe I could put some blank records in the source data?



Chester Kaup

Engineering Technician

Kinder Morgan CO2 Company, LLP

Office (432) 688-3797

FAX (432) 688-3799


--
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