Multiple Records/Line

  • Thread starter Thread starter Ardy
  • Start date Start date
A

Ardy

Posted this yesterday, but don't see it on the newsgroup?

---------------------------------

I am using the following code for multi column record
printing, referred to by another post.

I am trying to print a 2x2 records (2 rows, 2 columns) on
one page. the first page works fine, but on sub-sequent
pages the very first record (top left) is always blank??

pg 1
rec1 rec2
rec3 rec4

pg2
rec5
rec6 rec7


can any one point out why the first record is almost always
blank? (in some cases all 4 records show? and I havn't
been able to see a pattern. it is very in-consistent??)

thanks..



Option Compare Database
Option Explicit

Dim bytColumn As Byte
Dim lngColumnWidth As Long
Dim booNewRow As Boolean
Const bytNumOfColumns As Byte = 2

Private Sub Detail_Format(Cancel As Integer, FormatCount As
Integer)
Dim ctl As Control
For Each ctl In Me.Section(0).Controls
ctl.Left = bytColumn * lngColumnWidth + Val(ctl.Tag)
Next

'If Me.txtGroupCount = Me.txtRunningCount Or _
' bytColumn = bytNumOfColumns - 1 Then

If bytColumn = bytNumOfColumns - 1 Then
bytColumn = 0
booNewRow = True
Else
bytColumn = bytColumn + 1
booNewRow = False
End If
End Sub

Private Sub Detail_Print(Cancel As Integer, PrintCount As
Integer)

Me.MoveLayout = booNewRow

End Sub

Private Sub Report_Open(Cancel As Integer)
Dim ctl As Control
booNewRow = False
bytColumn = 0
'store the original position in the tag property
For Each ctl In Me.Section(0).Controls
ctl.Tag = ctl.Left
Next
Set ctl = Nothing
'get the width of one column
lngColumnWidth = Me.Width / bytNumOfColumns
End Sub
 
Ardy,
Please comment your code - it is difficult to understand what you are doing.

It appears that you do not know that Access has support for multi-colum
reports
Open the report in design mode, and click on File > Page Setup and select
the Columns tab

HS
 
Back
Top