在表单上激活现有记录 [英] Making existing record active on a form

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

问题描述

我创建了几个链接表来存储与医疗访问相关的信息,并将访问号码作为关键字段。在我创建的表单上,用户可以在访问号码中自由发送文本,系统会对数据库执行检查以查看它是否已存在(在AfterUpdate事件上完成)。我创建了一个检查字段(varCount)来验证记录是否已经存在,所以我知道它正在查找信息,但它不会将焦点改为现有记录。这是代码:

I''ve created several linked tables to store information related to medical visits with the visit numbers as key fields. On the form I''ve created, the user can free-text in the visit number and the system performs a check on the database to see if it already exists (completed on the AfterUpdate Event). I''ve created a check field (varCount) to verify if the record already exists so I know it''s finding the information, but it won''t change focus to the existing record. Here''s the code:

展开 | 选择 | Wrap | 行号

推荐答案

那是因为你正在使用recordsetCLONE,原始记录集的一个克隆。


对你的代码进行一些小的修改,因为我们正在查看它:
Thats because you are using the recordsetCLONE, a clone of the original recordset.

A few small modifications to your code is in order, since we are looking at it anyway:
展开 | 选择 | Wrap | 行号


感谢回复Smiley!我尝试应用建议的更改,但记录没有显示。我仍然得到指示器显示已存在记录,但记录的内容未显示在表单上。我对代码做了一些修改,因为它没有识别出一些对象。

Thanks for the reply Smiley! I tried applying the changes suggested, but the record doesn''t display. I still get the indicator showing that there''s an existing record, but the contents of the record do not show on the form. I made a few modifications to the code because it didn''t recognize some of the objects.

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


也许如果我在这个表格上澄清我的意图,可能会更清楚。该数据库将用于数据输入目的,因此用户将直接从纸质表单输入信息。在这个特定的表格上,他们输入患者标识符,并且我输入了系统,以便在输入关键字段帐户后检查表PatientData,以确定它是否已存在。如果是,则系统应该路由到现有记录;如果没有,那么它不应该做任何事情并允许用户继续在新记录上输入数据。我认为问题的一部分是我为用户创建了一条新记录来输入标识符信息,当我尝试从这个新创建的记录重定向焦点时,系统会尝试保存它和错误,因为它正在创建一个副本。重点可以重定向而不保存?似乎上面的代码不起作用(只要将表单重定向到现有记录),因为表单表明它仍然保留在新记录中。
Maybe if I clarify my intentions on this form it might be clearer. The database is to be used for data entry purposees, so users will be entering information directly from paper forms. On this particular form, they enter the patient identifiers and I have the system set to examine the table PatientData after the key field Account is entered to determine if it already exists. If it does, then the system should route to the existing record; if not, then it shouldn''t do anything and allow the user to continue with the data entry on the new record. I think part of the problem is that I create a new record for the user to enter the identifier information, and when I try to redirect focus from this newly created record the system tries to save it and errors because it''s creating a duplicate. Can focus be redirected without saving? It seems that the code above isn''t working (as far as redirecting the form to the existing record) because the form indicates that it''s remaining on the new record.


这篇关于在表单上激活现有记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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