通过vba对其进行分配时会触发哪些组合框事件 [英] What combobox events are triggered when an assignment is made to it via vba

查看:115
本文介绍了通过vba对其进行分配时会触发哪些组合框事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个组合框(cboTwo),您在其中键入办公室名称,如果该办公室名称不在列表中,则NotInList事件将打开一个表单。我有另一个组合框(cboOne)并创建一个记录,用于关联两个组合框中的条目(多对多)。


用户希望cboTwo像普通的组合框一样(一对多)。问题是现有记录可能合法地最终被复制。实际上,没有写,因为我已经阻止了。


我想保持系统不变,只需添加一个组合框(cboThree),它显示已经与所选实体关联的组合cboOne。这很好用。我在cboThree上使用NotInList事件将cboThree中的值赋给cboTwo。该值确实出现在cboTwo中,但手动单击则不执行任何操作。


NotInList似乎处理NewData(内置变量显然保存了组合框的文本框组件的值,同时对整个组合框进行了分配。

问题是当我进行赋值时,cboTwo上的NotInList事件不起作用。我已经在组合框事件中放置了消息框,但是在分配时似乎找不到任何改变。我试图点击cboThree,但是再一次,似乎没什么用。


任何帮助都将不胜感激。谢谢。


Dave44000

I have a combobox (cboTwo) where you type in an office name, and if that office name is not in the list, the NotInList event opens a form. I have another combobox (cboOne) and create a record associating the entries in both comboboxes (many-to-many).

A user wants cboTwo to act like a normal combobox (one-to-many). The problem will be that existing records could legitimately end up being duplicated. Actually, not written, since I''ve prevented that.

I want to leave the system unchanged and just add a combobox (cboThree) that displays the already associated with the entity selected in cboOne. This works fine. I use the NotInList event on cboThree to assign the value in cboThree to cboTwo. The value does appear in cboTwo, but manually clicking there does nothing.

NotInList appears to process NewData (built in variable that apparently holds the value of the text box component of the combobox while assignment is made to the whole combobox.

The problem is that the NotInList event on cboTwo does not work when I make the assignment. I have put messages boxes in the combobox events, but can''t seem to find anything that changes when the assignment was made. I''ve tried to click cboThree, but again, nothing seems to work.

Any help will be appreciated. Thanks.

Dave44000

推荐答案

基本事件顺序:
数据库对象的事件顺序(v2010)


这是一个混乱的事情(@ - @)
The basic Order of events:
Order of events for database objects (v2010)

That''s a muddle to follow (@-@)

问题在于NotInLi我做作业时,cboTwo上的st事件不起作用。我已将消息框放在组合框事件中
The problem is that the NotInList event on cboTwo does not work when I make the assignment. I have put messages boxes in the combobox events



检查属性是否设置正确(即不在列表中,启用,锁定等等)当我使用VBA将值插入我的CBO,所有事件都按预期激发,这就是为什么我要求你仔细检查控件上的属性设置。

Check that the properties are set correctly (ie. not in list, enabled, locked, etc...) When I use VBA to plug in values to my CBO, all of the events fire as expected which is why I am asking you to double check the property settings on your controls.


属性是


限制列表是

允许值列表编辑是

启用是

锁定否


允许值列表编辑为是,因为被调用的表单会添加记录并刷新列表。
The properties are

Limit To List Yes
Allow Value List Edits Yes
Enabled Yes
Locked No

Allow Values List Edits is Yes, because the form that gets called adds a record and a the list is refreshed.


什么是您的记录源CBO?

(对不起应该在我的第一篇文章中提出这个要求)


>你可能想看看选项4和选项4。在以下内容中:向查找表添加值 - Allen Browne
What is the record source for your CBO?
(sorry should have asked for that in my first post)

> and you might want to take a look at "option 4" in the following:Adding values to lookup tables - Allen Browne


这篇关于通过vba对其进行分配时会触发哪些组合框事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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