设为首页收藏本站Access中国

Office中国论坛/Access中国论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

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

[报表] report的activate时间里写的代码,为何在打印时无法显示

[复制链接]
跳转到指定楼层
1#
发表于 2008-10-9 17:05:49 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
Private Sub Report_Activate()
'DoCmd.Maximize
'Debug.Print "mm9b1="; Forms("jfmx_分系统").Form![m9c1]
Me.m1b1 = MM1b1: Me.m1c1 = MM1c1
'Me.m1b1 = Forms("jfmx_分系统").Form![m1b1] 'MM1b1: Me.m1c1 = MM1c1
Me.m1b2 = MM1b2: Me.m1c2 = MM1c2
Me.m1b3 = MM1b3: Me.m1c3 = MM1c3
Me.m1b4 = MM1b4: Me.m1c4 = MM1c4
Me.m1b5 = MM1b5: Me.m1c5 = MM1c5
在active中可以完成对报表窗体文本框赋值,可是在open中不可以,?打印的时候,active中的完成的赋值,却显示不出来,
Private Sub Report_Open(Cancel As Integer)
DoCmd.Maximize
Private Sub Report_Activate()
'DoCmd.Maximize
'Debug.Print "mm9b1="; Forms("jfmx_分系统").Form![m9c1]
Me.m1b1 = MM1b1: Me.m1c1 = MM1c1
'Me.m1b1 = Forms("jfmx_分系统").Form![m1b1] 'MM1b1: Me.m1c1 = MM1c1
Me.m1b2 = MM1b2: Me.m1c2 = MM1c2
Me.m1b3 = MM1b3: Me.m1c3 = MM1c3
Me.m1b4 = MM1b4: Me.m1c4 = MM1c4
Me.m1b5 = MM1b5: Me.m1c5 = MM1c5

End Sub
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享分享 分享淘帖 订阅订阅
2#
 楼主| 发表于 2008-10-9 17:29:49 | 只看该作者
解决了,在主体的format事件中写入代码就可以了。喝酒去了!
打印按钮代码: If MsgBox("按“是”打印当前记录并确认打印机的电源已开启及纸张(A3)是否足够!" & vbCrLf & "按 其它键 预览当前记录" & vbCrLf & "请选择!", 3 + vbQuestion, "重要提示") = vbYes Then
   
        'MsgBox "请确认打印机的电源已开启及纸张(A3)是否足够。"
    Me.Refresh
    DoCmd.OpenReport "分系统", acViewNormal   ', , "[流水号]=" & Me![sfmSubForm].Form![流水号] '"((Qry海事.流水号)=Me![sfmSubForm].Form![流水号]);" '"[流水号]=" & Me![sfmSubForm].Form![流水号] '"((Qry海事.流水号)=Me![sfmSubForm].Form![流水号]);"

   Me.Refresh
   
  '‘If Me.sfmSubForm.Form.FilterOn = True Then
       ' DoCmd.OpenReport "Qry海事", acViewPreview, , Me.sfmSubForm.Form.RecordSource 'Me.sfmSubForm.Form.Filter
    Else    '否则,不传递条件给报表
    Debug.Print "stemp="; stemp
        DoCmd.OpenReport "分系统打印", acViewPreview   ', , "[流水号]=" & Me![sfmSubForm].Form![流水号] '"select * from Qry海事 where " & STemp 'acViewPreview
    End If

报表中
Private Sub 主体_Format(Cancel As Integer, FormatCount As Integer)

Me.m1b1 = MM1b1: Me.m1c1 = MM1c1
Me.m1b2 = MM1b2: Me.m1c2 = MM1c2
Me.m1b3 = MM1b3: Me.m1c3 = MM1c3
Me.m1b4 = MM1b4: Me.m1c4 = MM1c4
Me.m1b5 = MM1b5: Me.m1c5 = MM1c5

Me.m1b6 = MM1b6: Me.m1c6 = MM1c6
Me.m1b7 = MM1b7: Me.m1c7 = MM1c7
Me.m1b8 = MM1b8: Me.m1c8 = MM1c8
Me.m1b9 = MM1b9: Me.m1c9 = MM1c9
Me.m1b10 = MM1b10: Me.m1c10 = MM1c10

Me.m1b11 = MM1b11: Me.m1c11 = MM1c11
Me.m1b12 = MM1b12: Me.m1c12 = MM1c12
Me.m1b13 = MM1b13: Me.m1c13 = MM1c13
Me.m1b14 = MM1b14: Me.m1c14 = MM1c14
Me.m1b15 = MM1b15: Me.m1c15 = MM1c15

Me.m1b16 = MM1b16: Me.m1c16 = MM1c16
Me.m1b17 = MM1b17: Me.m1c17 = MM1c17
Me.m1b18 = MM1b18: Me.m1c18 = MM1c18
Me.m1b19 = MM1b19: Me.m1c19 = MM1c19
Me.m1b20 = MM1b20: Me.m1c20 = MM1c20

Me.m1b21 = MM1b21: Me.m1c21 = MM1c21
Me.m1b22 = MM1b22: Me.m1c22 = MM1c22
Me.m1b23 = MM1b23: Me.m1c23 = MM1c23
Me.m1b24 = MM1b24: Me.m1c24 = MM1c24
Me.m1b25 = MM1b25: Me.m1c25 = MM1c25


Me.m9b16 = Forms("jfmx_分系统").Form![m9b16]: Me.m9c16 = Forms("jfmx_分系统").Form![m9c16]
Me.m9b17 = Forms("jfmx_分系统").Form![m9b17]: Me.m9c17 = Forms("jfmx_分系统").Form![m9c17]
Me.m9b18 = Forms("jfmx_分系统").Form![m9b18]: Me.m9c18 = Forms("jfmx_分系统").Form![m9c18]
Me.m9b19 = Forms("jfmx_分系统").Form![m9b19]: Me.m9c19 = Forms("jfmx_分系统").Form![m9c19]
Me.m9b20 = Forms("jfmx_分系统").Form![m9b20]: Me.m9c20 = Forms("jfmx_分系统").Form![m9c20]

Me.m9b21 = Forms("jfmx_分系统").Form![m9b21]: Me.m9c21 = Forms("jfmx_分系统").Form![m9c21]
Me.m9b22 = Forms("jfmx_分系统").Form![m9b22]: Me.m9c22 = Forms("jfmx_分系统").Form![m9c22]
Me.m9b23 = Forms("jfmx_分系统").Form![m9b23]: Me.m9c23 = Forms("jfmx_分系统").Form![m9c23]
Me.m9b24 = Forms("jfmx_分系统").Form![m9b24]: Me.m9c24 = Forms("jfmx_分系统").Form![m9c24]
Me.m9b25 = Forms("jfmx_分系统").Form![m9b25]: Me.m9c25 = Forms("jfmx_分系统").Form![m9c25]

Me.m9b26 = Forms("jfmx_分系统").Form![m9b26]: Me.m9c26 = Forms("jfmx_分系统").Form![m9c26]
Me.m9b27 = Forms("jfmx_分系统").Form![m9b27]: Me.m9c27 = Forms("jfmx_分系统").Form![m9c27]
Me.m9b28 = Forms("jfmx_分系统").Form![m9b28]: Me.m9c28 = Forms("jfmx_分系统").Form![m9c28]
Me.m9b29 = Forms("jfmx_分系统").Form![m9b29]: Me.m9c29 = Forms("jfmx_分系统").Form![m9c29]
Me.m9b30 = Forms("jfmx_分系统").Form![m9b30]: Me.m9c30 = Forms("jfmx_分系统").Form![m9c30]

Me.m9b31 = Forms("jfmx_分系统").Form![m9b31]: Me.m9c31 = Forms("jfmx_分系统").Form![m9c31]
Me.m9b32 = Forms("jfmx_分系统").Form![m9b32]: Me.m9c32 = Forms("jfmx_分系统").Form![m9c32]
Me.m9b33 = Forms("jfmx_分系统").Form![m9b33]: Me.m9c33 = Forms("jfmx_分系统").Form![m9c33]
Me.m9b34 = Forms("jfmx_分系统").Form![m9b34]: Me.m9c34 = Forms("jfmx_分系统").Form![m9c34]
Me.m9b35 = Forms("jfmx_分系统").Form![m9b35]: Me.m9c35 = Forms("jfmx_分系统").Form![m9c35]

Me.m9b36 = Forms("jfmx_分系统").Form![m9b36]: Me.m9c36 = Forms("jfmx_分系统").Form![m9c36]
Me.m9b37 = Forms("jfmx_分系统").Form![m9b37]: Me.m9c37 = Forms("jfmx_分系统").Form![m9c37]

sum01 = Forms("jfmx_分系统").Form![sum01]: sum02 = Forms("jfmx_分系统").Form![sum02]
sum03 = Forms("jfmx_分系统").Form![sum03]: sum04 = Forms("jfmx_分系统").Form![sum04]
sum05 = Forms("jfmx_分系统").Form![sum05]: sum06 = Forms("jfmx_分系统").Form![sum06]
sum07 = Forms("jfmx_分系统").Form![sum07]: sum08 = Forms("jfmx_分系统").Form![sum08]
sum = Forms("jfmx_分系统").Form![sum]
End Sub
3#
发表于 2008-10-9 17:30:52 | 只看该作者
没喝就醉了
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-12-2 02:01 , Processed in 0.093775 second(s), 27 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

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