组合框:禁用或灰显列表中的项目 [英] Combobox: disable or grey out items in the list

查看:49
本文介绍了组合框:禁用或灰显列表中的项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Access 2010,我试图禁用回馈如果我从组合框中选择它,但现在不工作,之前是因为我使用的是List,但我现在正在使用查询,任何帮助都会很感激它

Access 2010, I am trying to disable "Give back" if I select it from the combobox, but is not working now, before it was because I was using a List, but I am using a query now, any help will be appreciate it

展开 | 选择 | Wrap | 行号

推荐答案

ivonsurf,


当你''时我有点模糊'尝试使禁用/启用发生以及您尝试执行此操作的对象。您的代码表明Reason_for_Leaving是您要禁用/启用的字段,因此我正在操作该假设。如果您只是想在用户选择回馈时禁用该字段从组合框中,下面的代码应该做你需要的。但是,如果您试图在回馈时禁用它甚至可以选择,这将是另一回事。

ivonsurf,

I''m a little bit fuzzy on when you''re trying to make the disable/enable happen and which object you are trying to do it to. Your code indicates Reason_for_Leaving is the field you want disabled/enabled, so I''m operating off that assumption. If you simply want to disable the field when a user selects "Give Back" from the combo box, the code below should do what you need. If, however, you are trying to have it disable when "Give Back" is even an option to select, that would be another matter.

展开 | 选择 | Wrap | 行号


您好,


这是因为它没有用,因为Giveback在该组合框中列出了一个列表作为List,但现在不再是列表了,它是一个源码:query / Table,当我选择Give back时它不会变灰了。
Hello,

That''s the thing it does not work, before worked because the Give back was withing a list of options as a List in that combobox, but now is not longer a list, it is a source: query/Table, when I select Give back it does not go gray out anymore.


ivonsurf123,


像gnawoncents一样,我也是我有点困惑你试图解除什么即如果您的代码根据组合框中的选择设置行源,则实际上没有理由检查行源的值 - 只需按照推荐的方式引用组合框本身。

我们是否遗漏了一些关于您要做什么以及如何尝试的重要细节?
ivonsurf123,

Like gnawoncents, I, too, am a bit confused as to what it is that you are trying to disable. If your code sets the Row Source based on a selection from a Combo Box, then there is really no reason to check the value of the Row Source--simply refer to the Combo Box itself, as recommended.

Are we missing some important details about what you are trying to do and how you are trying to do it?


这篇关于组合框:禁用或灰显列表中的项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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