Report with a Gap Every Nth row ?

T

TK

I think I've done this before but I cannot remember how or
find the report:

What I want is to create a visual gap between every 5th
row in a report, and the count should reset at the
beginning of each report group. Something like:

Group Heading (1)

Row1
Row2
Row3
Row4
Row5

Row6
Row7
Row8
Row9

Group Heading (2)

Row1
Row2
Row3
Row4
Row5

Row6
Row7
Row8
Row9
Row10

Row11
.... and so on...

Any thoughts on the easiest way to do this?

Thanks,

TK
 
F

Fons Ponsioen

I copied this from Duane Hookum a while back:
From: "Duane Hookom" <duanehookom@NO_SPAMhotmail.com>
Sent: 4/23/2004 5:41:13 AM
You could add a text box in the detail section with:
Name: txtCount
Control Source: =1
Running Sum: Over All
Can Grow: Yes
Can Shrink: Yes
Back Color: Transparent
Fore Color: 16777215 'white
You shouldn't be able to see this and may want to send it
to the back. Then add code to the On Format event of the
detail section:
Private Sub Detail_Format(Cancel As Integer, FormatCount
As Integer)
If Me.txtCount Mod 5 = 0 Then
Me.txtCount.FontSize = 20 'adjust
Else
Me.txtCount.FontSize = 8 'adjust
End If
End Sub

Duane Hookom MS Access MVP

message
I have a ton if data printing on a single line,
landscaped on 8.5 x 14. What I'd like to do (for clarity
in using
this report) is put a small space underneath each 5th
line. Is this possible? Thanx - David

Hope this helps.
Fons
 
T

TK

Thanks, Thak does help.

I also found my initial approach, which I based on the
Sybex Developer's Handbook a while back. In case another
approach is of interest the code goes like this:

Dim intLineCount As Integer

Private Sub Detail_Print(Cancel As Integer, PrintCount As
Integer)
Call HandleLine
End Sub

Private Sub HandleLine()
Dim HideLine As Boolean
'break every 10 lines:
Const BreakCount = 10

HideLine = ((intLineCount Mod (BreakCount + 1)) = 0)
If HideLine Then
'If not showing current row do not move to
'next record and do not print
Me.NextRecord = False
Me.PrintSection = False
Me.MoveLayout = True
intLineCount = 0
End If
intLineCount = intLineCount + 1
End Sub

Then, you can reset the intLineCount variable wherever
needed with the code:

intLineCount = 0,

In my case I reset it in the Print event of the Page
Heading and Group Headings, and i'm in business!

Thanks again.

TK
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top