2455错误 - 对属性RecordSource的无效引用 [英] 2455 error - invalid reference to property RecordSource

查看:132
本文介绍了2455错误 - 对属性RecordSource的无效引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,尝试修复一个错误,我发现/创建了另一个错误。我被建议开始一个新的主题并附上完整的代码我正在'''''''''''''''''''''''''''''''''''''''''''''' br />

我这个代码的目标是允许我搜索我的简单数据库(两个由自动编号ID列链接的表)。我已经从互联网上修改了代码,使用了这里的帮助和我非常基本的VBA知识(主要来自Excel宏和逻辑,而不是Access知道如何)。


这里是VBA位:

So trying to fix one error, I have discovered/created another. I was advised to start a new thread and attach the full code I''m ''working with'' (''ineffectually clubbing at'' might be a better term to describe where I''m at right now!).

My goal with this code is to allow me to search my simple database (two tables linked by an autonumbered ID column). I have adapted code from the internet, using help from here and my very rudimentary VBA knowledge (mostly from Excel macros and logic, rather than Access know how).

Here''s the VBA bits:

展开 | 选择 | Wrap | 行号

推荐答案

在我们开始之前,请确保您有项目的备份副本。


发布的代码块第2行的第24行请插入停止命令。

保存,关闭,重新打开表格

使用用户通常输入的条目设置表单,然后单击命令按钮。

代码应进入调试模式,VBA编辑器窗口打开,停止代码为highligh ted(通常为黄色)。

使用{[F8]}键通过代码 - 慢慢地。请报告错误实际发生的行。
Before we start, please ensure that you have a backup copy of the project.

Line 24 of the posted code block post #1 please insert a STOP command.
Save, close, reopen the form
Setup the form with the entries a user would normally made and click on the command button.
The code should go into debug mode and the VBA editor window open with the stop code highlighted (usually in yellow).
Using the {[F8]} key step thru your code - slowly. Please report back what line the error actually occurs.


我没有太多机会查看代码,但通常导致此错误的原因是用户尝试访问子表格本身而非实际的子表格控制。语法将是:
I didn''t have much of a chance to look at the Code, but what typically causes this Error is that the User attempts to access the Sub-Form itself as opposed to the actual Sub-Form Control. The Syntax would be:
展开 | 选择 | Wrap | 行号


我怀疑失败将出现在第32行或第35行由ADEzii给出的原因是两者都引用了子表单。


这就是为什么我想要一步到位,因为我不确定两者中的哪一个会失败。
I''m suspecting that the fail will be on either line 32 or 35 for the reason given by ADEzii in that both make reference to the subform.

This is why I wanted the step thru as I''m not sure which of the two will fail.


这篇关于2455错误 - 对属性RecordSource的无效引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆