查找现有记录,错误:2115 [英] Find Existing Records, Error: 2115

查看:127
本文介绍了查找现有记录,错误:2115的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我是Access的新手,并且编码经验非常少。


我正在尝试修改代码(请参阅由TheSmileyCoder在本网站发布。


基本上,代码检查现有记录。给出了3个选项:


1.保存新记录

2.找到重复记录转到

3.取消和撤消


选项2.返回运行时错误:2115并且调试器突出显示行Me.Bookmark = Me.RecordsetClone.Bookmark


从我所看到的问题来看,这个问题与保存记录有关。但我不知道如何解决这个问题。我想代码打开表单中的现有记录。


有人可以帮忙吗?


谢谢,

Dave Rapson
<格ID = codeHolder 类= codeHolder>

<跨度类= codeLink 的onclick = 模糊(此,this.parentNode.parentNode,的getChildren(本),TRUE);>展开 | 选择 | < /跨度> <跨度类= codeLink 的onclick = 自动换行(在此);>裹 <跨度类= codeDivider> | <跨度类= codeLink 的onclick =LineNumbers(这个);>行号

解决方案

1)请在报告错误时,

哪个操作系统

哪个版本的访问/办公室

报告确切的标题,编号和文字。精彩的MS程序员在某些情况下重新使用了文本,在其他情况下重新使用了标题。此外,很高兴不必拔出列表并通过一千个错误代码来查找报告内容。


2)控件脏了,记录然而,移动强制保存,因为代码仍然在更新前事件中运行,记录无法保存...我将不得不查看我的一些代码,看看为什么取消= true你的'并不清楚。


3)恕我直言:你真的应该设置一个指向记录集克隆的指针。每次调用me.recordsetclone时,都可能设置不同的指针。如果你这样做,记得把指针设置为空......

展开 | 选择 | Wrap | 行号



我必须查看我的一些代码,看看为什么取消=真在你的'不清楚。

取消=真 = / = 致电{控制或表格}。撤消()


您好ZMBD,

感谢您的回复和建议。作为回复,我在Windows 8 Professional上使用MS Access Professional Plus 2013.


确切的错误消息如下:

运行时错误''2115'':此字段的BeforeUpdate或Validation Rule属性中设置的宏或函数阻止交易场所数据库在现场保存数据。


交易场所数据库是数据库的名称。


2.我将不得不阅读脏手段


3.我改变了我的代码如下,但得到一个错误:

运行时错误''3426'':此操作已被关联对象取消。
<登记/>
与调试器突出了线" zRS.Bookmark = zRSClone.Bookmark"

展开 | 选择 | 换行 | 行号


Hi,

I am New to Access and have very little coding experience.

I am trying to modify the code (see below) posted by TheSmileyCoder on this site.

Basically, the code checks for existing records. 3 options are given:

1. Save new record
2. Duplicate found go to that the record
3. Cancel and Undo

Option 2. returns a runtime error:2115 and the debugger highlights the line "Me.Bookmark = Me.RecordsetClone.Bookmark"

From what I have read the problem has to do with saving the record. But I have no idea how to fix this. I would like the code to open the existing record in the form.

Can someone help?

Thank you,

Dave Rapson

Expand|Select|Wrap|Line Numbers

解决方案

1) Please, when reporting errors,
Which OS
Which Version of Access/Office
Report the exact title, number and text. The wonderfull MS programers re-used the text in some cases and title in other. Besides, it''s nice not to have to pull out the list and hunt thru a thousand error codes to find what the report is.

2) The control is dirty, a record move forces a save, however, because the code is still running in the before update event, the record can''t be saved... I''ll have to look at some of my code to see why the cancel=true in your''s didn''t clear.

3) IMHO: you really should set a pointer to the recordsetclone. Each time you invoke the me.recordsetclone you potentially set a different pointer. If you do, remember to set the pointer back to nothing...

Expand|Select|Wrap|Line Numbers


I''ll have to look at some of my code to see why the cancel=true in your''s didn''t clear.

Cancel = True =/= Call {Control or form}.Undo()


Hi ZMBD,

Thank you for your response and suggestions. In reply I am using MS Access Professional Plus 2013 on Windows 8 Professional.

The exact error message is as follows:

Run-time error ''2115'': The Macro or function set in the BeforeUpdate or Validation Rule property for this field is preventing Trading Places Database from saving the data in the field.

"Trading Places Database" is the name of the database.

2. I will have to read up on what "dirty means"

3. I changed my code as to as below but get an error:

Run-time error ''3426'': This action was cancelled by an associated object.

and the debugger highlights the line "zRS.Bookmark = zRSClone.Bookmark"

Expand|Select|Wrap|Line Numbers


这篇关于查找现有记录,错误:2115的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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