设为首页收藏本站Access中国

Office中国论坛/Access中国论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

返回列表 发新帖
查看: 1369|回复: 2
打印 上一主题 下一主题

[报表] 请教指定打印第几页的问题

[复制链接]
跳转到指定楼层
1#
发表于 2009-6-20 09:11:08 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
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:能不能指定打印机打印


谢谢了!
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享分享 分享淘帖 订阅订阅
2#
发表于 2009-6-20 11:02:52 | 只看该作者
可能要在报表的page事件中累加统计
3#
 楼主| 发表于 2009-6-23 16:37:06 | 只看该作者
没有人知道吗?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|站长邮箱|小黑屋|手机版|Office中国/Access中国 ( 粤ICP备10043721号-1 )  

GMT+8, 2024-6-6 22:05 , Processed in 0.090230 second(s), 27 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表