Printing a table type report

L

Leif

I have a report that is mostly a table. I've added horizontal and vertical
lines to give it a table appearance.

The first thing I noticed is the table did not start printing on page 1, it
started on page 2. The next thing I notice is that my labels, thay contain
the text in the table "cells", were being split between pages.

On a hunch I removed all the vertical lines. Sure enough, that seem to be
causing the problems in both cases. In guess Access was trying to print the
vertical lines on a single page. Failing that it simply prints the report up
to the limits of the page length.

Is there a way around this problem? I'm thinking one possible solution is
to draw multiple vertical lines, just the length of that row. That will
entail a fair amount of work. Anyone else have a solution?

Thanks,
Leif
 
K

Klatuu

One way is to set the Border Style and Border Width properties for each text
box and label and make sure they are close enough together so it looks like
one line.
 
L

Leif

Klatuu,

The problem with your suggestion is that I have some text fields that can
grow. If they grow then currently Access "pushes down" the line and other
controls below. If I just used the border property the table would look very
odd. Now that I think about it, that also presents a problem with my idea in
my first post regarding the vertical lines.
 
K

Klatuu

Just remembered a report I did that had the same problem. Here is some code
that does what you want. you just have to include the controls on the report
you want the lines around, and put the value "Border" in their tag properties:

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Dim intMaxHeight As Integer
Dim ctl As Control
'Find highest control in Detail section _
that has a tag property of "Border"
For Each ctl In Me.Section(0).Controls
If ctl.Tag = "Border" Then
If ctl.Height > intMaxHeight Then
intMaxHeight = ctl.Height
End If
End If
Next ctl
'Draw a box around each control in Detail _
' that has a tag property of "Border"
For Each ctl In Me.Section(0).Controls
If ctl.Tag = "Border" Then
Me.Line (ctl.Left, ctl.Top)- _
Step(ctl.Width, intMaxHeight), vbBlack, B
End If
Next

End Sub
 

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