Function PrintCatalogReport(RptName As String)
Dim Rpt As Report
Dim PagesCount, i As Long
Dim myPrompt As String
myPrompt = "请将出纸器中已打印好一面的纸取出并将其放回到送纸器中,然后按下""确定"",继续打印"
DoCmd.OpenReport RptName, acViewPreview
Set Rpt = Reports(0)
PagesCount = Rpt.Pages
If PagesCount = 0 Then
MsgBox "Microsoft Access 未发现任何可以打印的内容", 0 + 48
DoCmd.Close acReport, RptName
Exit Function
ElseIf PagesCount = 1 Then
MsgBox "Microsoft Access 只有一页何须麻烦", 0 + 48
DoCmd.PrintOut acPages, 1, 1
Exit Function
End If
For i = 1 To PagesCount Step 2 '打印奇数页
DoCmd.PrintOut acPages, i, i
Next i
MsgBox myPrompt, 0 + 48
For i = 2 To PagesCount Step 2 '打印偶数页
DoCmd.PrintOut acPages, i, i
Next i
DoCmd.Close acReport, RptName
End Function