Audit Trail代码中的错误3265(在集合中找不到项) [英] Error 3265(item not found in collection) in Audit Trail code

查看:74
本文介绍了Audit Trail代码中的错误3265(在集合中找不到项)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好

我正在使用微软审计跟踪示例ACC2000:如何在表单中创建记录更改的审计跟踪,并且我的记录集有问题。


在他们使用绑定表单的示例中,因此名为tbAuditTrail的文本框具有表中AuditTrail字段的控件源。我的表格没有约束。我试图将我的tbAuditTrail文本框同步到表中的AuditTrail字段,但是当我运行表单时,我得到了在集合错误中找不到的项目。它突出显示以下代码行:Me.tbAuditTrail = rstMain(" AuditTrail")

< span class =codeLinkonclick =Blur(this,this.parentNode.parentNode,getChildren(this),true);>展开 | 选择 | Wrap | 行号

解决方案
您好。错误消息表明没有名为AuditTrail的字段。在指定的记录集中。 ''此集合中未找到的项目''表示给定的字段名称未包含在该记录集的字段集合中。


你应该检查相关字段的确切拼写 - 如果它在单词Audit和单词Trail之间有一个空格,你需要稍微不同地引用它,因为


rstmain(" [Audit Trail]")



rstmain![审计跟踪]

例如。


你使用未绑定的表格给自己做了很多工作但是......


-Stewart


我还浏览了你提到的MS知识库文章。它根本不使用任何称为审计跟踪的字段 - 该文章涉及设置各种其他字段值的自定义函数。我想知道你是否只是误解了你如何接近MS功能的实现?


无论如何,我不能再猜测你的表结构或你如何选择实现第三方功能,但我觉得误解MS解决方案是导致实施失败的根本原因。

-Stewart

你好斯图尔特

非常感谢快速回复。你是完全正确的,我拼错了表名,我不再得到错误,但我仍然有问题。没有审核信息写在文本框tbAuditTrail和表格中。


我使用未绑定表单的原因是因为我必须拆分数据库并将其放在服务器。我已经完成了(经过长时间的斗争)并且最后一刻出现了审计线索要求。这是我第一次使用访问权限,我在审计跟踪问题上进行了大量研究,发现了许多不起作用的例子,微软的例子似乎是我的最后一个选择。这是我的代码示例。

展开 | 选择 < span class =codeDivider> | Wrap | 行号


hello
i''m using the microsoft audit trail example ACC2000: How to Create an Audit Trail of Record Changes in a Form and im having a problem with my recordset.

in the example they are using a bound form so the text box called tbAuditTrail has a control source of the AuditTrail field in the table. My form is unbound. i tried to conncet my tbAuditTrail text box to the AuditTrail field in the table, but when i run the form i get the item not found in collection error. and it highlights the following line of code:Me.tbAuditTrail = rstMain("AuditTrail")

Expand|Select|Wrap|Line Numbers

解决方案

Hi. The error message is saying that there is no field called "AuditTrail" in the recordset specified. ''Item not found in this collection'' means the field name as given is not contained in the fields collection of that recordset.

You should check the exact spelling of the field concerned - if it has a space between the word Audit and the word Trail you would need to refer to it slightly differently, as

rstmain("[Audit Trail]")
or
rstmain![Audit Trail]

for example.

You are giving yourself a lot of work by using an unbound form, however...

-Stewart


I also skimmed the MS Knowledge base article you mentioned. It does not use any fields called ''audit trail'' at all - the article relates to a custom function which sets up various other field values. I wonder if you are simply mistaken in how you are approaching implementation of the MS function?

In any event, I can''t second guess your table structures or how you choose to implement a third-party function, but I have the feeling that misunderstanding of the MS solution is the root cause of your lack of success with implementation.

-Stewart


Hello stewart
thanks so much for the quick reply. you were totally right, i had mispelled the table name and im no longer getting the error but i do still have a problem. there is no audit information being written in the text box tbAuditTrail and the table.

the reason im using an unbound form is because im going to have to split the database and place it on the server. i had finished (after a long struggle) and the audit trail requirement came up last minute. this is my first time using access and i researched alot on the audit trail issue and found numerous examples that didn''t work this Microsoft example seems to be the last option i have. here is a sample of my code.

Expand|Select|Wrap|Line Numbers


这篇关于Audit Trail代码中的错误3265(在集合中找不到项)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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