|
MajP (TechnicalUser) |
15 Oct 12 18:59 |
You can print X empty rows in a report with some code. However, not certain how you set this up used for the different pages since the first page has only 16 records and the second 21.
But I would think the logic would be if
the number of records is less than 16 records add N blank records to make 16. Not sure why you would need 31 because that would be an all blank second page.
16 < X < 37 add N blank records to equal 37
37 < X < 58 add N blank records to equal 58
58 < X < 79 add N blank records to equal 79
....
CODEPublic Function getnumberofBlanks() As Integer
Dim recordCount As Integer
Dim N As Integer
recordCount = DCount("*", Me.RecordSource)
If recordCount <= 16 Then
getnumberofBlanks = 16 - recordCount
Else
N = 1
Do while N * 21 + 16 <= recordCount
N = N + 1
Loop
getnumberofBlanks = (N * 21 + 16) - recordCount
End If
End Function
Public Sub printBlankRecords(numberBlanks As Integer)
Dim recordCount As Integer
recordCount = DCount("*", Me.RecordSource)
TotalCount = TotalCount + 1
If TotalCount = recordCount Then
Me.NextRecord = False
'once you get to the last record, stay on last record
ElseIf TotalCount > recordCount And TotalCount < (recordCount + numberBlanks) Then
Me.NextRecord = False
'make the font and backcolor the same appearing to be empty record
Me.fldOne.ForeColor = Me.fldOne.BackColor
Me.fldTwo.ForeColor = Me.fldTwo.BackColor
End If
End Sub
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
printBlankRecords getnumberofBlanks
End Sub
I did not fully test the logic for getting the number of blanks. I think it is correct. I like doing very formatting complex forms in word because it makes formatting easier, but requires much more code. |
|