级联组合框不令人耳目一新 [英] cascaded combo boxes not refreshing

查看:84
本文介绍了级联组合框不令人耳目一新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

很抱歉,我在这里发布了很多关于级联组合框的问题,但每次我解决一个问题时,我似乎都面临着新的问题。这一次是问题所在:我的组合框或多或少都在工作,但它们不会刷新。我只允许有机会在第一个组合框中选择值。如果我尝试将其更改为其他值,则第二个(从属)组合框仅在第一个组合框中显示我的第一个选项中的选项。当我导航进入新记录时,这会重复。我试图将以下代码放在表单'的属性的当前事件中:


Private Sub Form_Current()

Me.Product.Requery

结束子


但这样做会以某种方式消除第二个组合框中任何选项的可用性。这是另一个非常令人沮丧的问题,任何帮助都将非常受欢迎。

Sorry, I''ve been posting alot of questions regarding cascaded combo boxes here but each time I solve one problem I seem to be faced with a new. This time here''s the problem: I''ve got the combo boxes more or less working but they don''t refresh. I''m only allowed one chance to choose the value in the first combo box. If I try to change it to another value, the second (dependent) combo box only displays the options from my first choice in the first combo box. This repeats itself when I navigate to enter a new record. I attempted to put the following code in the Current Event of the form''s property:

Private Sub Form_Current()
Me.Product.Requery
End Sub

But doing this somehow erases the availability of any choices in the second combo box. This is yet another very frustrating problem and any help would be most appreciated.

推荐答案

在第一个组合'的AfterUpdate事件中,您需要重新查询第二个组合,如:

Me.cmb2.requery

或什么时候不能使用;

Me.cmb2.recordsource = Me.cmb2.recordsource


Nic; o)
In the first combo''s AfterUpdate event you need to requiry the second combo like:
Me.cmb2.requery
or when that doesn''t work use;
Me.cmb2.recordsource = Me.cmb2.recordsource

Nic;o)


我很遗憾地报告这些解决方案都不起作用。一旦我在第一个组合框中做出选择,第二个组合框就会有一组不可更改的选择,包括当前记录和下一个组合。还有更多想法吗?
I''m sorry to report that neither of those solutions worked. Once I make a choice in the first combo box, the second combo box then has an unchangeable set of choices, both in the current record and in the next one. Any more ideas?


说谎 - 它有效!我误解了你的帖子,并认为我需要摆脱On Current属性。它现在正在运行(最终!0 - 我想。当我导航进入另一条记录时,我只需要让第一个组合框变成空白。这不应该是困难的,对吧​​?只是我不是肯定要做到这一点......
Tell a lie - it works! I misunderstood your post and thought I needed to get rid of the On Current property. It''s now functional (finally!0 - I think. I just need to make the first combo box come up blank when I navigate to enter another record. That shouldn''t be dificult, right? Only I''m not sure h ow to do it...


这篇关于级联组合框不令人耳目一新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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