设为首页收藏本站Access中国

Office中国论坛/Access中国论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

返回列表 发新帖
楼主: qlm
打印 上一主题 下一主题

[报表] 简单的固定每页行数报表制作示例分页报表

[复制链接]
11#
 楼主| 发表于 2006-11-23 02:56:00 | 只看该作者
代码如下(有更改):

Option Compare Database
Dim aaa As Long '行数

Private Sub Report_Open(Cancel As Integer)
aaa = InputBox("请输入固定的行数[试用建议1-6]", "请输入行数", 3)
End Sub

Private Sub 主体_Format(Cancel As Integer, FormatCount As Integer)
If Me.counter Mod aaa = 0 Then '每隔aaa行分页
Me.PageBreak9.Visible = True
Else
Me.PageBreak9.Visible = False
End If

End Sub

Private Sub 主体_Print(Cancel As Integer, PrintCount As Integer)
Dim CtlDetail As Control
Dim intLineMargin As Integer

intLineMargin = 60

For Each CtlDetail In Me.Section(acDetail).Controls
    With CtlDetail
      If CtlDetail.ControlType <> acPageBreak Then
        If CtlDetail.Name <> "Memo" Then
        Me.Line ((.Left + .Width + intLineMargin), 1)-(.Left + .Width + _
intLineMargin, Me.Height)
        End If
        End If
    End With
   
Next
   

    With Me
        Me.Line (1, 1)-Step(.Width, .Height), 1, B
    End With

Set CtlDetail = Nothing
End Sub
12#
发表于 2006-11-30 19:12:00 | 只看该作者
谢谢

13#
发表于 2006-12-1 00:08:00 | 只看该作者
下载学习,正需要

14#
发表于 2008-9-12 00:42:42 | 只看该作者
太好了,刚刚要用。
15#
发表于 2008-10-14 16:08:43 | 只看该作者
[:50] [:50]
16#
发表于 2008-11-23 13:05:53 | 只看该作者
good
17#
发表于 2008-11-25 21:25:04 | 只看该作者
[:26] [:24]
18#
发表于 2008-11-28 10:00:03 | 只看该作者
下载学习。。
19#
发表于 2008-11-29 12:02:18 | 只看该作者
看看[:28]
20#
发表于 2009-3-1 15:52:12 | 只看该作者
学习中。。。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-4-27 01:45 , Processed in 0.082472 second(s), 33 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

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