如何修复VBA中的MS访问Enumfields错误
我刚刚开始学习VBA访问。因此,我使用一些网站的示例“ https://learn.microsoft.com/en-us/office/client-developer/access/access/access-home”。
当代码包含“枚举”时,其执行会生成错误“ sub或函数未定义”。
我无法理解其原因,最重要的是,我不知道如何消除它。
例如:
Sub WhereX()
Dim dbs As Database, rst As Recordset
Set dbs = OpenDatabase("Northwind.mdb")
Set rst = dbs.OpenRecordset("SELECT LastName, " _
& "FirstName FROM Employees " _
& "WHERE LastName = 'King';")
rst.MoveLast
EnumFields rst, 12
dbs.Close
End Sub
I just started studying VBA for Access. I am therefore using some examples of site "https://learn.microsoft.com/en-us/office/client-developer/access/access-home".
When the code contains "EnumFiels" its execution generates the error "Sub or Function not defined".
I can't understand the reason for it and, above all, I don't know how to eliminate it.
For instance:
Sub WhereX()
Dim dbs As Database, rst As Recordset
Set dbs = OpenDatabase("Northwind.mdb")
Set rst = dbs.OpenRecordset("SELECT LastName, " _
& "FirstName FROM Employees " _
& "WHERE LastName = 'King';")
rst.MoveLast
EnumFields rst, 12
dbs.Close
End Sub
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论