运行-时间错误“2465”- 找不到字段 MS Access
run-time error '2465' - can't find field MS Access
我在报表上有一个字段,该字段由单独表单上的组合框填充。我在执行我的代码时收到一条错误消息,指出“无法找到您的表达式中引用的字段‘|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
结果发现即使名称正确,访问也找不到我的报告。在代码 运行 没有任何错误之前,我必须将它添加为 Microsoft Access Class 对象。
我在报表上有一个字段,该字段由单独表单上的组合框填充。我在执行我的代码时收到一条错误消息,指出“无法找到您的表达式中引用的字段‘|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
结果发现即使名称正确,访问也找不到我的报告。在代码 运行 没有任何错误之前,我必须将它添加为 Microsoft Access Class 对象。