不管他产生的原因,头痛医头脚痛医脚就行了,加两个条件判断一下再进行处理就行了:
Private Sub 主体_Print(Cancel As Integer, PrintCount As Integer)
'If L = lAllRecords - 1 And L < lAllPrintRecords Then
' showHideCtrlAtDetail False '原来为false
'End If
'针对错误1:当不需要不空行时则退出,不执行后面代码。
If lAllRecords = lAllPrintRecords Then Exit Sub
L = L + 1
If L = lAllRecords Then
Me.NextRecord = False '原来为false
ElseIf L > lAllRecords And L < lAllPrintRecords Then
Me.NextRecord = False '原来为false
showHideCtrlAtDetail False '原来为false
End If
'针对错误2:当全部记录数正好比需打印总行数少一条时,当达到最后一条时,执行隐藏字符代码(showHideCtrlAtDetail False)。
If lAllRecords = lAllPrintRecords - 1 And L = lAllPrintRecords Then
showHideCtrlAtDetail False
End If
End Sub
点击下载此附件