【问题标题】:run-time error '2465' - can't find field MS Access运行时错误“2465” - 找不到字段 MS Access
【发布时间】:2015-07-16 05:39:09
【问题描述】:

我在报表上有一个字段,该字段由单独表单上的组合框填充。我在执行代码时收到错误消息,指出“找不到表达式中引用的字段 '|1' - 我在数据库的不同模块中有完全相同的代码,它可以正常工作,所以我没有确定我做错了什么。提前感谢您的帮助。

Private Sub Reportfilter_bt_Click()

    If IsNull(User_cb.Value) = True Then
        MsgBox "Please select a user from the dropdown menu", vbCritical, "Database Error"
    Else

        DoCmd.OpenReport "RWA Allocation by User", acViewReport

        [Report_RWA Allocation by User].Filterby_txt.Value = User_cb.Column(1)

        DoCmd.Close acForm, "RWA Task Report"

    End If

End Sub

【问题讨论】:

  • 调试的时候,错误指向哪一行?
  • [Report_RWA 按用户分配].Filterby_txt.Value = User_cb.Column(1)

标签: ms-access vba ms-access-2010


【解决方案1】:

事实证明,即使名称正确,访问也找不到我的报告。我必须将它添加为 Microsoft Access 类对象,然后代码才能运行而不会出现任何错误。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多