Adding Blank Lines to a Report

Joined
Oct 17, 2012
Messages
1
Reaction score
0
I am working on a report that will print out the Army hand recipt (DA Form 2062). The form itselt can consist of one page or multiple pages. The first page of the form has room for 16 lines of data, and each page after has room for 21 lines of data. In order for the form to be deemed "legal" for use, it has to be the whole form. So I will need the report to print with blanks lines of data based upon the number of items input by the user.

For instance if X:
16 > X add N blank records to equal 16
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

so on and so forth.

My report is being populated from a table call OC. The table has two columns Equipment and Item.

I was provided the following code to use but cannot seem to get it to work and think I may be doing something wrong:

Public Function getnumberofBlanks() As Integer Dim recordCount As Integer Dim N As Integer recordCount = DCount("*", Me.OC) 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 IfEnd FunctionPublic Sub printBlankRecords(numberBlanks As Integer) Dim recordCount As Integer recordCount = DCount("*", Me.OC) 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.Equipment.ForeColor = Me.Equipment.BackColor Me.Item.ForeColor = Me.Item.BackColor End IfEnd SubPrivate Sub Detail_Print(Cancel As Integer, PrintCount As Integer) printBlankRecords getnumberofBlanksEnd Sub The code does not add any blank lines to the report when printed. I just can't figure it out. Any help or suggestions anyone can provide would be greatly appreciated.
 
Back
Top