更改记录的组合框不会触发On_Current事件 [英] Combo box to change record not triggering the On_Current event

查看:64
本文介绍了更改记录的组合框不会触发On_Current事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是好奇这是否正常。我在表单(标题部分)中有一个组合框,用于转到表单中的特定记录。它使用DoCmd.SearchForRecord方法。我刚刚发现使用组合框转到记录时不会触发表单的On_Current事件。从我记忆中,它应该。在这种特殊情况下,它并不重要,因为所有On_Current事件都会调用sub,所以我可以从组合框的After_Update事件中调用sub。


我也有一个允许我输入值的文本框,它使用Me.Recordset.FindFirst方法查找记录。但是,它会触发表单的On_Current事件。只是在去记录的方法上有区别吗?

I''m just curious if this is normal. I have a combobox on a form (in the title section) that I use to go to a specific record in the form. It uses the DoCmd.SearchForRecord method. I just discovered that using the combobox to go to a record doesn''t trigger the On_Current event of the form. From what I remember, it should. In this particular case it doesn''t matter as all the On_Current event does is call a sub so I can just call the sub from the After_Update event of the combobox.

I also have a textbox that allows me to type in a value and it uses the Me.Recordset.FindFirst method to find the record. However, it triggers the On_Current event of the form. Is the difference just in the method of going to the record?

推荐答案

Seth:

区别在于记录方法的区别?
Seth:
Is the difference just in the method of going to the record?



我会这么认为。文档对于您的版本中的每种方法都说了什么?

I would think so Seth. What does the documentation say for each approach in your version?


在Access 2010联机文档中,它没有说明触发事件的任何内容。再一次,我觉得我甚至使用了DoCmd.SearchForRecord方法并让它触发了表单的On_Current事件。我将不得不查看我的所有数据库,看看能否知道我的记忆是否正确地为我服务。至少它似乎并不常见,它不起作用。
In the Access 2010 online documentation, it doesn''t say anything about triggering events. Again, I feel like I have even used the DoCmd.SearchForRecord method and had it trigger the On_Current event of the form. I''ll have to look through all of my databases and see if I can find out if my memory is serving me correctly. At least it doesn''t seem to be common knowledge that it doesn''t work.


我检查了我的2003文档,但没有发现 DoCmd.SearchForRecord( )(可能是因为它是我后来想到的),而且 Me.Recordset.FindFirst()与触发了哪些事件无关。我知道没用。


我建议你自己进行调查(测试),看看最合适的用途。
I checked in my 2003 docs and found nothing at all for DoCmd.SearchForRecord() (probably because it was introduced later I''m thinking), and nothing for Me.Recordset.FindFirst() that pertained to which events were triggered. Not helpful I know.

I suggest you do your own investigation (testing) and see what makes best sense to use.


这篇关于更改记录的组合框不会触发On_Current事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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