Office中国论坛/Access中国论坛

标题: 为什么设置报表的数据集不行的,窗体的就可以. [打印本页]

作者: yodong    时间: 2009-5-5 16:02
标题: 为什么设置报表的数据集不行的,窗体的就可以.
Private Sub Report_Open(Cancel As Integer)
Dim aa As Variant
aa = Me.OpenArgs
Dim rs As New ADODB.Recordset
Dim cn As ADODB.Connection
Set cn = CurrentProject.Connection
    If IsLoaded("pub_frm产品编号生成器") Then
    Set rs = cn.Execute("exec xs_pro_me产品编号生成表  '" & Forms!cl_frmlogin!username & "'")
    Else
    Set rs = cn.Execute(aa)
    End If
    Set Me.Recordset = rs
    rs.Close
    Set rs = Nothing
    Set cn = Nothing
End Sub




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