|
Function PrintCatalogReport(RptName As String)
Dim Rpt As Report
Dim PagesCount, i As Long
Dim myPrompt As String
DoCmd.OpenReport RptName, acViewPreview
Set Rpt = Reports(0)
PagesCount = Rpt.Pages
If PagesCount = 0 Then
MsgBox "未发现任何可以打印的内容", 0 + 48
DoCmd.Close acReport, RptName
Exit Function
ElseIf PagesCount = 1 Then
MsgBox "当前报表只有一页", 0 + 48
DoCmd.PrintOut acPages, 1, 1
Exit Function
End If
MsgBox "总共有", , "页", 0 + 48
Dim FindStr As String
FindStr = InputBox("请输入页码", "打印")
If Not IsNull(FindStr) Then
DoCmd.PrintOut acPages, FindStr, FindStr
DoCmd.Close acReport, RptName
End If
End Function
'问题1:pagescount 总是为0 难道不能这样统计?
'问题2:Msgbox 能不能显示总共有"pagescount"页 代码怎么写
'问题3:能不能指定打印机打印
谢谢了! |
|