Office中国论坛/Access中国论坛

标题: 如何根据窗体的内容打印报表? [打印本页]

作者: pwj2009    时间: 2011-10-22 14:05
标题: 如何根据窗体的内容打印报表?
本帖最后由 pwj2009 于 2011-10-22 14:17 编辑

有2个子窗体。子窗体1 、子窗体2
如何选择子窗体1、自动筛选子窗体2 ,按打印打印出筛选后子窗体2的内容。
.我用了 以下代码不成功,、请高手指点下!!
Dim str As String
            If Forms!主窗体!子窗体2.Form.FilterOn = True Then
                str = Forms!主窗体!子窗体2.Form.Filter
            Else
                str = ""
            End If
        DoCmd.OpenReport "借", acViewPreview, , str, acWindowNormal
作者: pwj2009    时间: 2011-10-24 08:51
沙发自己坐。继续等待高手回答。。!
作者: yehf    时间: 2011-10-24 10:42
Private Sub Command4_Click()
'       Dim str As String
'            If Forms!主窗体!子窗体2.Form.FilterOn = True Then
'                str = Forms!主窗体!子窗体2.Form.Filter
'            Else
'                str = ""
'            End If
  DoCmd.OpenReport "借", acViewPreview, , "名称id=" & Me.子窗体1!ID, acWindowNormal
End Sub
作者: pwj2009    时间: 2011-10-24 14:27
yehf 发表于 2011-10-24 10:42
Private Sub Command4_Click()
'       Dim str As String
'            If Forms!主窗体!子窗体2.Form.F ...

谢谢!楼上的兄弟!!!!




欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/) Powered by Discuz! X3.3