尝试执行Recordset.FindFirst时收到错误消息3426 [英] Getting error message 3426 when trying to do a Recordset.FindFirst

查看:101
本文介绍了尝试执行Recordset.FindFirst时收到错误消息3426的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个搜索表单,允许用户输入客户名称,它会显示所有类似用户输入名称的记录。然后,用户只需双击记录,就会显示记录在主窗体中(已经打开)。我为此而开发的代码大部分时间都可以使用,但并非始终如此。当它不起作用时,我得到一个错误号3426,上面写着此操作已被相关对象取消。这是代码:

I have a search form that allows the user to type in a customer name and it brings up all the records that are like the name the user typed in. The user then just double clicks on the record and it will bring up that record in the main form (which is already open). The code that I have developed to do this works most of the time, but not all of the time. When it doesn''t work, I get an error number 3426 that says "This action was cancelled by an associated object." Here is the code:

展开 | 选择 | Wrap | 行号

推荐答案

当您告诉表单更改当前行时,您将导致一些要发射的事件。当表单尝试更新对当前行(在FindFirst之前)所做的任何更改时,可能会有一些验证失败。如果在搜索之前没有对表单进行任何更改,您可以对此进行排除。


确保您已获得验证消息和错误处理。
As you tell the form to change the current row you are causing a number of events to fire. It could be there is some validation that fails when the form tries to update any changes that were made to the current row (prior to the FindFirst). You can rule that out if no changes were made on the form prior to the search.

Make sure you''ve got validation messages and error handling where appropriate.


我对每一个程序都有错误处理,无论多么微不足道。除了在BeforeUpdate事件中手动操作之外,我也没有使用验证规则。
I have error handling on every single procedure, no matter how insignificant. I also don''t use validation rules except for manually in BeforeUpdate events.


我在想数据库验证,就像''添加记录''过程已经开始但是关键字段并没有全部填写所以db不允许添加完成。


是否在任何一个表格上发生任何编辑或只是一个查询?
I was thinking to database validation, like a ''add record'' process had gotten started but the key fields weren''t all filled in so the db wouldn''t allow the add to complete.

Is any editing happening on either form or is it simply an inquiry?


这篇关于尝试执行Recordset.FindFirst时收到错误消息3426的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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