I am using Access 2013 on Windows 8
I have a subreport with the following code in the details on print event.
This code makes the report print blank lines. The number of blanks is determined by max students - number of records.
This is working when the sub report is open by its self. It doesn't work from the main report.
Any ideas how to get this to work from the main report?
Thanks for looking
I have a subreport with the following code in the details on print event.
Code:
Public totalCount As Integer Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer) ' Dim students As Integer, maxR As Integer students = Me.Txcountrecords maxR = Me.txMaxStudent printBlankRecords Me, students, maxR End Sub Private Sub GroupHeader0_Print(Cancel As Integer, PrintCount As Integer) Me.txFull_Name.ForeColor = vbBlack Me.txeMail.ForeColor = vbBlack Me.txPhone.ForeColor = vbBlack totalCount = 0 End Sub Public Sub printBlankRecords(rpt As Access.Report, usedRecords As Integer, MaxRecords As Integer) totalCount = totalCount + 1 If totalCount = usedRecords Then rpt.NextRecord = False 'once you get to the last record, stay on last record ElseIf totalCount > usedRecords And totalCount < MaxRecords Then rpt.NextRecord = False 'MsgBox usedRecords & " " & MaxRecords & " " & totalCount 'make the font and backcolor the same appearing to be empty record Me.txFull_Name.ForeColor = Me.txFull_Name.BackColor Me.txeMail.ForeColor = Me.txeMail.BackColor Me.txPhone.ForeColor = Me.txPhone.BackColor End If End Sub
This is working when the sub report is open by its self. It doesn't work from the main report.
Any ideas how to get this to work from the main report?
Thanks for looking
Comment