Office中国论坛/Access中国论坛

标题: 为何会出错? [打印本页]

作者: ngw123    时间: 2004-7-3 23:06
标题: 为何会出错?
Sub Print_Field_Names()

    Dim rst As Recordset, intI As Integer

    Dim fld As Field

    Set rst = Me.RecordsetClone

    For Each fld In rst.Fields

        ' Print field names.

        Debug.Print fld.Name

    Next

End Sub

这段代码是帮助里的事例,为什么运行时会出错,

错误提示:类型不比配!在行Set rst = Me.RecordsetClone
作者: goodidea    时间: 2004-7-4 00:40
Sub Print_Field_Names()

    Dim rst As Dao.Recordset, intI As Integer

    Dim fld As Dao.Field    Set rst = Me.RecordsetClone

    For Each fld In rst.Fields

        ' Print field names.

        Debug.Print fld.Name

    Next

End Sub




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